12345678910111213141516171819202122232425262728293031323334353637 |
- using FairyGUI;
- using UI.Common;
- using UnityEngine;
- namespace GFGGame
- {
- public class ViewGlobal
- {
- private static UI_ComHolder comHolder;
- private static GameObject _gameObj;
- private static GoWrapper _wrapper;
- public static void CreatClickEffect()
- {
- if (comHolder == null)
- {
- comHolder = UI_ComHolder.Create();
- comHolder.target.touchable = false;
- ViewManager.AddChildToFloatLayer(comHolder.target);
- comHolder.target.SetPosition(-100, -100, 0);
- string resPath = ResPathUtil.GetViewEffectPath("ui_dj", "DJ");
- SceneController.AddObjectToView(_gameObj, _wrapper, comHolder.m_holder, resPath, out _gameObj, out _wrapper);
- GRoot.inst.onTouchBegin.Add(SetClickPos);
- }
- }
- private static void SetClickPos()
- {
- Vector2 pos = GRoot.inst.GlobalToLocal(Stage.inst.touchPosition);
- comHolder.m_holder.visible = false;
- comHolder.m_holder.visible = true;
- comHolder.target.SetPosition(pos.x, pos.y, 0);
- }
- }
- }
|