Example #1
0
        private T _CloneOneObject(int i, List <T> list, Action <int, T> CallBack, GroupConfig config)
        {
            T t = null;

            if (i < list.Count)
            {
                t = list[i];
            }
            else
            {
                if (config.tempT == null)
                {
                    t = (T)((Component)FEngineManager.PoolObject(config.resName, config.parent.gameObject));
                }
                else
                {
                    t = FEngineManager.CloneObject <T>(config.tempT.gameObject, null);
                }
                list.Add(t);
            }

            t.gameObject.SetActive(true);

            if (config.toolData != null)
            {
                config.toolData.HandTool(i, t);
            }

            if (CallBack != null)
            {
                CallBack(i, t);
            }
            return(t);
        }
Example #2
0
 public static GameObject CloneObject(GameObject mainObject, GameObject pos = null)
 {
     return(FEngineManager.CloneObject(mainObject, pos));
 }
Example #3
0
 public static T CloneObject <T>(GameObject go, GameObject trans = null) where T : Component
 {
     return(FEngineManager.CloneObject <T>(go, trans));
 }