void CreateEffectChannel() { ClearChannel(m_dicEffectChannel); m_dicEffectChannel.Clear(); SHUtils.ForToEnum <eSoundEffectChannel>((eEffectChannel) => { var pObject = SHGameObject.CreateEmptyObject(eEffectChannel.ToString()); pObject.transform.SetParent(transform); m_dicEffectChannel.Add(eEffectChannel, SHGameObject.GetComponent <AudioSource>(pObject)); }); }
Transform GetRoot(int iLayer) { if (false == m_dicRoots.ContainsKey(iLayer)) { var pRoot = SHGameObject.CreateEmptyObject(string.Format("SHObjectPool_{0}", iLayer)); pRoot.layer = iLayer; DontDestroyOnLoad(pRoot); m_dicRoots.Add(iLayer, pRoot.transform); } return(m_dicRoots[iLayer]); }
public static T GetInstance() { lock (m_pLocker) { if (null == m_pInstance) { if (null == (m_pInstance = SHGameObject.FindObjectOfType <T>())) { Initialize(SHGameObject.CreateEmptyObject(typeof(T).ToString()).AddComponent <T>()); } } return(m_pInstance); } }
// 인터페이스 : 빈 게임오브젝트를 생성하고 컴퍼넌트를 추가한뒤 얻어낸다. public T GetCreateComponent <T>(string strName) where T : Component { return(SHGameObject.GetComponent <T>(SHGameObject.CreateEmptyObject(strName))); }