zhaoyang 3 жил өмнө
parent
commit
7e4bbb6cc4

+ 6 - 0
FGUIProject/assets/Common/components/ComHolder.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="10,10">
+  <displayList>
+    <graph id="n0_pf26" name="holder" xy="0,0" size="10,10"/>
+  </displayList>
+</component>

+ 1 - 0
FGUIProject/assets/Common/package.xml

@@ -34,6 +34,7 @@
     <component id="ih7595" name="Button11.xml" path="/components/" exported="true"/>
     <image id="ih7592" name="tctc_anniu_1.png" path="/imagesExport/"/>
     <image id="ih7591" name="tctc_anniu_2.png" path="/imagesExport/"/>
+    <component id="pf2696" name="ComHolder.xml" path="/components/" exported="true"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Common" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Common/UI_ComHolder.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Common
+{
+    public partial class UI_ComHolder
+    {
+        public GComponent target;
+        public GGraph m_holder;
+        public const string URL = "ui://mk0fwx0xpf2696";
+        public const string PACKAGE_NAME = "Common";
+        public const string RES_NAME = "ComHolder";
+        private static UI_ComHolder _proxy;
+
+        public static UI_ComHolder Create(GObject gObject = null)
+        {
+            var ui = new UI_ComHolder();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ComHolder Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComHolder();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_holder = (GGraph)comp.GetChild("holder");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_holder = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Common/UI_ComHolder.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4f0a697cc40c4a440a2c22d24215013a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 29 - 0
GameClient/Assets/Game/HotUpdate/GameGlobal.cs

@@ -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);
+        }
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/HotUpdateEntry.cs

@@ -8,7 +8,7 @@ namespace GFGGame.HotUpdate
     public class HotUpdateEntry
     {
 
-        public static async void Start()
+        public static void Start()
         {
             VEngine.Logger.Loggable = false;
             Debug.Log("HotUpdateEntry Start");

BIN
GameClient/Assets/ResIn/UI/Common/Common_fui.bytes