Beispiel #1
0
 public static void SetChildAlpha(Component parentComp, string path, float alpha)
 {
     if (IsTargetNotNull(parentComp))
     {
         UIRect rect = CompAgent.FindChild <UIRect>(parentComp, path);
         SetAlpha(rect, alpha);
     }
 }
Beispiel #2
0
 public static void SetChildTweenValue(Component parentComp, string path, float value, int group = 0)
 {
     if (IsTargetNotNull(parentComp))
     {
         Transform child = CompAgent.FindChild(parentComp, path);
         SetTweenValue(child, value, group);
     }
 }
Beispiel #3
0
 public static void SetChildDepth(Component parentComp, string path, int depth)
 {
     if (IsTargetNotNull(parentComp))
     {
         UIRect rect = CompAgent.FindChild <UIRect>(parentComp, path);
         SetDepth(rect, depth);
     }
 }
Beispiel #4
0
 public static void SetChildIcon(Component parentComp, string path, UIAtlas atlas, string spriteName = null)
 {
     if (IsTargetNotNull(parentComp))
     {
         UISprite uiSprite = CompAgent.FindChild <UISprite>(parentComp, path);
         SetIcon(uiSprite, atlas, spriteName);
     }
 }
Beispiel #5
0
 public static void SetChildSize(Component parentComp, string path, float width, float height)
 {
     if (IsTargetNotNull(parentComp))
     {
         Transform child = CompAgent.FindChild <Transform>(parentComp, path);
         SetSize(child, width, height);
     }
 }
Beispiel #6
0
 public static void SetChildSprite(Component parentComp, string path, string spriteName)
 {
     if (IsTargetNotNull(parentComp))
     {
         UISprite sprite = CompAgent.FindChild <UISprite>(parentComp, path);
         SetSprite(sprite, spriteName);
     }
 }
Beispiel #7
0
 public static void SetChildTexture(Component parentComp, string path, Texture mainTexture, Texture alphaTexture = null, string shaderName = null)
 {
     if (IsTargetNotNull(parentComp))
     {
         UITexture uiTexture = CompAgent.FindChild <UITexture>(parentComp, path);
         SetTexture(uiTexture, mainTexture, alphaTexture, shaderName);
     }
 }
Beispiel #8
0
 public static void SetChildText(Component parentComp, string path, string text)
 {
     if (IsTargetNotNull(parentComp))
     {
         UILabel label = CompAgent.FindChild <UILabel>(parentComp, path);
         SetText(label, text);
     }
 }
Beispiel #9
0
 public static void SetChildFont(Component parentComp, string path, UIFont font)
 {
     if (IsTargetNotNull(parentComp))
     {
         UILabel label = CompAgent.FindChild <UILabel>(parentComp, path);
         SetFont(label, font);
     }
 }
Beispiel #10
0
 public static void SetChildEffectColor(Component parentComp, string path, Color color)
 {
     if (IsTargetNotNull(parentComp))
     {
         UILabel label = CompAgent.FindChild <UILabel>(parentComp, path);
         SetEffectColor(label, color);
     }
 }
Beispiel #11
0
 /// <summary>
 /// if action is null, please use ClearDrag instead
 /// </summary>
 public static void SetChildOnDrag(Component parentComp, string path, params System.Action <GameObject, Vector2>[] actions)
 {
     if (IsTargetNotNull(parentComp))
     {
         Transform trans = CompAgent.FindChild <Transform>(parentComp, path);
         SetOnDrag(trans, actions);
     }
 }
Beispiel #12
0
 public static void SetChildColor(Component parentComp, string path, Color color)
 {
     if (IsTargetNotNull(parentComp))
     {
         Transform child = CompAgent.FindChild(parentComp, path);
         SetColor(child, color);
     }
 }
Beispiel #13
0
 public static float PlayChildReverse(Component parentComp, string path, bool restart = false, int group = 0)
 {
     if (IsTargetNotNull(parentComp))
     {
         Transform child = CompAgent.FindChild <Transform>(parentComp, path);
         return(PlayReverse(child, restart, group));
     }
     return(0);
 }
Beispiel #14
0
        private void ResetLua()
        {
            if (m_LuaTable != null)
            {
                CompAgent.ClearChildren(transform);
                CompAgent.ClearCompnents <LuaBehaviour>(transform);
                m_LuaTable = null;

                List <string> loadedRemoveList = new List <string>();
                m_LoadedTable.ForEach <string, object>((luaName, value) => loadedRemoveList.Add(luaName));
                foreach (string luaName in loadedRemoveList)
                {
                    if (!m_LoadedBuiltInSet.Contains(luaName))
                    {
                        m_LoadedTable.Set <string, object>(luaName, null);
                    }
                }
                List <string> preloadRemoveList = new List <string>();
                m_PreloadTable.ForEach <string, object>((luaName, value) => preloadRemoveList.Add(luaName));
                foreach (string luaName in preloadRemoveList)
                {
                    if (!m_PreloadBuiltInSet.Contains(luaName))
                    {
                        m_PreloadTable.Set <string, object>(luaName, null);
                    }
                }

                foreach (LuaTable csTable in m_HotFixDict.Keys)
                {
                    foreach (string fieldName in m_HotFixDict[csTable])
                    {
                        m_HotFix(csTable, fieldName, null);
                    }
                }
                m_HotFixDict.Clear();
                foreach (LuaTable csTable in m_HotFixExDict.Keys)
                {
                    foreach (string fieldName in m_HotFixExDict[csTable])
                    {
                        m_HotFixEx(csTable, fieldName, null);
                    }
                }
                m_HotFixExDict.Clear();

                List <string> globalVarRemoveList = new List <string>();
                m_LuaEnv.Global.ForEach <string, object>((key, value) => globalVarRemoveList.Add(key));
                foreach (string varName in globalVarRemoveList)
                {
                    if (!m_GlobalVarBuiltInSet.Contains(varName))
                    {
                        m_LuaEnv.Global.Set <string, object>(varName, null);
                    }
                }

                FuncInvoke(m_LuaEnv.Global, "collectgarbage");
            }
        }
Beispiel #15
0
		public static LuaTable AddLuaChild(Component comp, string name, string luaPath, params object[] args)
		{
			GameObject go = CompAgent.AddChild(comp, name);
			return AddLuaComponent(go, luaPath, args);
		}
 private T AddChild <T>() where T : MonoBehaviour
 {
     return(CompAgent.AddChild <T>(this));
 }