Ver Fonte

添加邀请函界面骰子特效

leiyasi há 1 ano atrás
pai
commit
f823bde045

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CreateRole/UI_ButtonDice.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.CreateRole
+{
+    public partial class UI_ButtonDice
+    {
+        public GButton target;
+        public GGraph m_holder;
+        public const string URL = "ui://5al8chbdxt5s4";
+        public const string PACKAGE_NAME = "CreateRole";
+        public const string RES_NAME = "ButtonDice";
+        private static UI_ButtonDice _proxy;
+
+        public static UI_ButtonDice Create(GObject gObject = null)
+        {
+            var ui = new UI_ButtonDice();
+            if(gObject == null)
+            	ui.target =  (GButton)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GButton)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ButtonDice Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ButtonDice();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GButton)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GButton)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/CreateRole/UI_ButtonDice.cs.meta

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

+ 3 - 2
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CreateRole/UI_EnvelopeModel.cs

@@ -9,7 +9,7 @@ namespace UI.CreateRole
         public GComponent target;
         public GGraph m_NiaoEffectHolder;
         public GButton m_btnSure;
-        public GButton m_btnDice;
+        public UI_ButtonDice m_btnDice;
         public GTextInput m_inputName;
         public GGraph m_ShanZiEffectHolder;
         public GGraph m_TextEffectHolder;
@@ -67,7 +67,7 @@ namespace UI.CreateRole
         {
             m_NiaoEffectHolder = (GGraph)comp.GetChild("NiaoEffectHolder");
             m_btnSure = (GButton)comp.GetChild("btnSure");
-            m_btnDice = (GButton)comp.GetChild("btnDice");
+            m_btnDice = (UI_ButtonDice)UI_ButtonDice.Create(comp.GetChild("btnDice"));
             m_inputName = (GTextInput)comp.GetChild("inputName");
             m_ShanZiEffectHolder = (GGraph)comp.GetChild("ShanZiEffectHolder");
             m_TextEffectHolder = (GGraph)comp.GetChild("TextEffectHolder");
@@ -81,6 +81,7 @@ namespace UI.CreateRole
         {
             m_NiaoEffectHolder = null;
             m_btnSure = null;
+            m_btnDice.Dispose();
             m_btnDice = null;
             m_inputName = null;
             m_ShanZiEffectHolder = null;

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Views/CreateRole/CreateRoleView.cs

@@ -52,13 +52,14 @@ namespace GFGGame
 
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bg_yaoqinghan");
             _ui.m_envelopeModel.m_btnSure.onClick.Add(OnClickBtnSure);
-            _ui.m_envelopeModel.m_btnDice.onClick.Add(() =>
+            _ui.m_envelopeModel.m_btnDice.target.onClick.Add(() =>
             {
                 RandomRoleName().Coroutine();
             });
         }
 
         //private bool test = false;
+        private Animator _btnDiceAnimator;
         private void ChangeAnimationState(State state)
         {
             switch (state)
@@ -83,6 +84,8 @@ namespace GFGGame
                 case State.OPEN:
                     EffectUIPool.Recycle(_effectUIDic["FX_player"]);
                     _effectUIDic.Remove("FX_player");
+                    _effectUIDic.Add("FX_TZ_DJ", EffectUIPool.CreateEffectUI(_ui.m_envelopeModel.m_btnDice.m_holder, "ui_CreateRoleUI/After_Open", "FX_TZ_DJ"));
+                    _btnDiceAnimator = _effectUIDic["FX_TZ_DJ"].GetObj().GetComponentInChildren<Animator>();
                     _effectUIDic.Add("FX_Text", EffectUIPool.CreateEffectUI(_ui.m_envelopeModel.m_TextEffectHolder, "ui_CreateRoleUI/After_Open", "FX_Text"));
                     _effectUIDic.Add("FX_ShanZi", EffectUIPool.CreateEffectUI(_ui.m_envelopeModel.m_ShanZiEffectHolder, "ui_CreateRoleUI/After_Open", "FX_ShanZi"));
                     _effectUIDic.Add("FX_Niao", EffectUIPool.CreateEffectUI(_ui.m_envelopeModel.m_NiaoEffectHolder, "ui_CreateRoleUI/After_Open", "FX_Niao"));
@@ -147,6 +150,8 @@ namespace GFGGame
 
         private async ETTask RandomRoleName()
         {
+            _btnDiceAnimator?.SetTrigger("click");
+
             string name = await LoginController.ReqRandomRoleName();
             if (_ui != null && _ui.m_envelopeModel.m_inputName != null)
             {

BIN
GameClient/Assets/ResIn/UI/CreateRole/CreateRole_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/CreateRole/CreateRole_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/CreateRole/CreateRole_fui.bytes