예제 #1
0
 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));
     });
 }
예제 #2
0
    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]);
    }
예제 #3
0
    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);
        }
    }
예제 #4
0
 // 인터페이스 : 빈 게임오브젝트를 생성하고 컴퍼넌트를 추가한뒤 얻어낸다.
 public T GetCreateComponent <T>(string strName) where T : Component
 {
     return(SHGameObject.GetComponent <T>(SHGameObject.CreateEmptyObject(strName)));
 }