コード例 #1
0
ファイル: Prefab.cs プロジェクト: Swift-Yu/GameEngine
        public void CratePrefab(ref string strPrefabName, CreatePrefabEvent callBack, object custumParam = null, TaskPriority ePriority = TaskPriority.TaskPriority_Normal)
        {
            m_callback      = callBack;
            m_ePriority     = ePriority;
            m_strPrefabName = strPrefabName;
            //custumParam
            if (custumParam is List <string> )
            {
                List <string> lstDepend = (List <string>)custumParam;
                if (lstDepend.Count > 0)
                {
                    m_nLoadCount = lstDepend.Count;
                    m_LoadIndex  = 0;

                    m_denpenArray = new AssetBundleResource[lstDepend.Count];

                    for (int i = 0; i < lstDepend.Count; i++)
                    {
                        string path            = lstDepend[i];
                        AssetBundleResource ab = ResourceManager.Instance().GetAssetBundle(ref path, OnLoadDepende, null, ePriority);
                    }
                }
                else
                {
                    m_res = ResourceManager.Instance().GetAssetBundle(ref m_strPrefabName, LoadFinishDelegate, null, m_ePriority);
                }
            }
            else
            {
                m_res = ResourceManager.Instance().GetAssetBundle(ref m_strPrefabName, LoadFinishDelegate, null, m_ePriority);
            }
        }
コード例 #2
0
        public IPrefab CreatePrefab(string strPrefabName, CreatePrefabEvent callBack, object custumParam = null,
                                    TaskPriority ePriority = TaskPriority.TaskPriority_Normal)
        {
            Prefab prefab = new Prefab();

            prefab.CratePrefab(ref strPrefabName, callBack, custumParam, ePriority);
            return(prefab);
        }