|
@@ -1,5 +1,8 @@
|
|
|
+using FairyGUI;
|
|
|
using UnityEngine;
|
|
|
using VEngine;
|
|
|
+using UI.Common;
|
|
|
+
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -22,11 +25,16 @@ namespace GFGGame
|
|
|
public static ET.Scene zoneScene;
|
|
|
public const string LoginAddress = "127.0.0.1:10002";
|
|
|
|
|
|
+ private static UI_ComHolder comHolder;
|
|
|
+ private static GameObject _gameObj;
|
|
|
+ private static GoWrapper _wrapper;
|
|
|
+
|
|
|
public static void Init()
|
|
|
{
|
|
|
loginApiUrl = LauncherConfig.loginApiUrl;
|
|
|
gameApiUrl = loginApiUrl;//外网
|
|
|
gameApiUrlTest = "http://localhost:8081/api/";
|
|
|
+ CreatClickEffect();
|
|
|
}
|
|
|
|
|
|
public static string version
|
|
@@ -36,5 +44,26 @@ namespace GFGGame
|
|
|
return Application.version + "." + Versions.ManifestsVersion;
|
|
|
}
|
|
|
}
|
|
|
+ private static void CreatClickEffect()
|
|
|
+ {
|
|
|
+ if (comHolder == null)
|
|
|
+ {
|
|
|
+ comHolder = UI_ComHolder.Create();
|
|
|
+ ViewManager.AddChildToTopLayer(comHolder.target);
|
|
|
+
|
|
|
+ string resPath = ResPathUtil.GetViewEffectPath("ui_dj", "ui_dj");
|
|
|
+ SceneController.AddObjectToView(_gameObj, _wrapper, comHolder.m_holder, resPath, out _gameObj, out _wrapper);
|
|
|
+ GRoot.inst.onClick.Add(SetClickPos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private static void SetClickPos()
|
|
|
+ {
|
|
|
+ // Vector2 pos = Stage.inst.touchPosition;
|
|
|
+ Vector2 pos = GRoot.inst.GlobalToLocal(Stage.inst.touchPosition);
|
|
|
+ Debug.Log("pos:" + pos);
|
|
|
+ comHolder.m_holder.visible = false;
|
|
|
+ comHolder.m_holder.visible = true;
|
|
|
+ comHolder.target.SetPosition(pos.x, pos.y, 0);
|
|
|
+ }
|
|
|
}
|
|
|
}
|