Exemple #1
0
    private static void OnSceneLoadFinish(string sceneName)
    {
        isHaveData = false;
        //如果是非吃鸡场景,卸载.
        if (GameLogicAPI.getCurGameMode() != Game_ManagedDef.EGameMode.EGM_MCAMP)
        {
            AssetBundleManager.DeleteAssets(ref SafeZoneEffectRes, true);
            SafeZoneEffectInstance = null;
            return;
        }
        if (null == SafeZoneEffectRes)
        {
            SafeZoneEffectRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, SafeZoneEffectGUID, true);
            if (!ResNode.isNullOrEmpty(SafeZoneEffectRes))
            {
                SafeZoneEffectInstance = SafeZoneEffectRes.InstanceMainRes <Effect.EffectNode>();
                if (SafeZoneEffectInstance)
                {
                    SafeZoneEffectInstance.Init();
                    SafeZoneEffectInstance.StopEffect();
                    SafeZoneTransform = SafeZoneEffectInstance.transform;
                    SafeZoneTransform.SetParent(EntityFactory.EffectGroup.transform);

                    GenerateZoneMaterial(SafeZoneEffectInstance);
                }
            }
        }

        if (SafeZoneEffectInstance)
        {
            SafeZoneEffectInstance.StopEffect();
        }
    }
 public static void EnableDeadEffect()
 {
     if (DeadEffectRes == null)
     {
         DeadEffectRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "CommonPrefab/Effect/selectEffect/DeadEffect");
         if (null != DeadEffectRes)
         {
             m_DeadEffect = DeadEffectRes.InstanceMainRes <Effect.EffectNode>();
             m_DeadEffect.isStaticEffect = false;
             m_DeadEffect.PlayOnAwake    = false;
             m_DeadEffect.Init();
             GameObject.DontDestroyOnLoad(m_DeadEffect.gameObject);
         }
     }
     if (m_DeadEffect)
     {
         m_DeadEffect.PlayEffect(false, -1, null, null);
     }
 }