public static GameObject GetPoolTrans(PoolType type) { if (IsInitialed == false) { Debug.LogError("BaseObject Pool Not Initialed"); return(null); } GameObject result = null; m_AllPoolView.TryGetValue(type, out result); if (result != null) { return(result); } switch (type) { case PoolType.MsgBox: result = GenerationObjUtility.CreateObjectByName("MseeageBoxPool", ObjectPoolTrans, true); // result = CommonOperate.CreateObjWhithName("MseeageBoxPool", ObjectPoolTrans); break; case PoolType.MeshLine: result = GenerationObjUtility.CreateObjectByName("MseeageBoxPool", ObjectPoolTrans, true); // result = CommonOperate.CreateObjWhithName("MeshLinePool", ObjectPoolTrans); break; } result.transform.SetTransLocalState(Vector3.one, Vector3.one * 100000, Vector3.zero, false); m_AllPoolView[type] = result; return(result); }
public static object GetPoolByType(PoolType type, string sourcesPath, uint maxCount = 0) { if (IsInitialed == false) { Debug.LogError("BaseObject Pool Not Initialed"); return(null); } if (ObjectPoolTrans == null) { GenerationObjUtility.CreateObjectByName("BaseObjectPool", null, true); } object result = null; if (m_AllPoolDataBase.TryGetValue(type, out result)) { return(result); } switch (type) { case PoolType.MsgBox: result = new MseeageBoxPool(sourcesPath, maxCount); m_AllPoolDataBase[type] = result; GetPoolTrans(type); break; //case PoolType.MeshLine: // result = new MeshLinePool(sourcesPath, maxCount); // m_AllPoolDataBase[type] = result; // GetPoolTrans(type); // break; } return(result); }
void CreateUIRootOnLevel() { #region FixedDirectionUI UIRoot FixedDirUIRoot.gameObject.name = "FixedDirectionUI"; m_AllUIRootBaseOnLevelDic.Add(UIPanelLevel.FixedDirectionUI, FixedDirUIRoot); #endregion #region FollowTargetUI UIRoot GameObject FollowTargetUIObj = GenerationObjUtility.CreateObjectByName("FollowTargetUI", null, true); GameObject.DontDestroyOnLoad(FollowTargetUIObj); m_AllUIRootBaseOnLevelDic.Add(UIPanelLevel.FollowTargetUI, FollowTargetUIObj.transform); #endregion #region SceneUI UIRoot GameObject SceneUIObj = GenerationObjUtility.CreateObjectByName("SceneUI", null, true);// CommonOperate.CreateObjWhithName("SceneUI"); GameObject.DontDestroyOnLoad(SceneUIObj); SceneUIObj.AddComponent <UIManager_SceneUILevel>(); m_AllUIRootBaseOnLevelDic.Add(UIPanelLevel.SceneUI, SceneUIObj.transform); #endregion }