Пример #1
0
 public void OnLoadFinish(Transform CacheParent, ResNode effectPrefabRes)
 {
     AssetBundleManager.SaveMemory(effectPrefabRes);
     prefabResNode = effectPrefabRes;
     stage         = loadingStage.Stage_Finish;
     Init(CacheParent);
     foreach (LightingEffectResHandleInstance instance in m_AllInstanceNode)
     {
         LightingEffectResHandleInstance.FillInstance(currCahceTransform, this, instance);
         if (instance.isCached)
         {
             Quaternion qtn = Quaternion.identity;
             if (prefabResNode != null)
             {
                 qtn = prefabResNode.GetResRotation();
             }
             instance.OnCache(currCahceTransform, currCachePos, qtn);
         }
     }
 }
Пример #2
0
    public LightingEffectResHandleInstance Instantiate()
    {
        LightingEffectResHandleInstance instance = null;

        if (m_CacheList.Count > 0)
        {
            instance = m_CacheList.Dequeue();
            //先看看是不是加载完成了。加载完成之后,再看看是否有效
            if (stage == loadingStage.Stage_Finish)
            {
                if (isValid)
                {
                    if (!instance.Valid)
                    {
                        instance.Clear();
                        LightingEffectResHandleInstance.FillInstance(currCahceTransform, this, instance);
                    }
                }
            }
        }
        else
        {
            LightingEffectResHandleInstance.BuildInstance(this, ref instance);
            m_AllInstanceNode.Add(instance);
            //先看看是不是加载完成了。加载完成之后,再看看是否有效
            if (stage == loadingStage.Stage_Finish)
            {
                if (isValid)
                {
                    LightingEffectResHandleInstance.FillInstance(currCahceTransform, this, instance);
                }
            }
        }
        instance.isCached = false;
        return(instance);
    }