Пример #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();
        }
    }
Пример #2
0
    public void Update()
    {
        if (test)
        {
            test = false;

            ResNode itemNode = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "Effect/Scene/UI/StaticState/Baoshi/" + szModelPath);
            if (itemNode == null)
            {
                return;
            }

            Effect.EffectNode itemObject = itemNode.InstanceMainRes <Effect.EffectNode>();
            if (itemObject == null)
            {
                return;
            }

            //itemObject.StopEffect();
            itemObject.PlayEffect(false, -1, itemObject.SrcObj, itemObject.DstObj);
            itemObject.transform.SetParent(parent, false);
            itemObject.transform.localPosition = new UnityEngine.Vector3(0f, 0f, 0f);
        }
        if (testDelete)
        {
            testDelete = false;
            SceneEffectManager.Instance.DestroySceneEffect(ref deleteParam);
        }
    }
 public void Clear()
 {
     m_effect_ReplaceAnimation = null;
     m_effectNode            = null;
     m_effectPrefab          = null;
     m_effectConfig          = null;
     m_effectPrefabTransform = null;
     m_EffectID = -1;
 }
Пример #4
0
    private static bool GenerateZoneMaterial(Effect.EffectNode end)
    {
        if (SafeZoneEffectInstance.FastestModlues.m_effect_Play.Length != 1)
        {
            Debug.LogError("毒圈光效m_effect_Play.Length != 1");
            return(false);
        }

        if (SafeZoneEffectInstance.FastestModlues.m_effect_Play[0].m_MeshRender.Length != 2)
        {
            Debug.LogError("m_effect_Play[0].m_MeshRender.Length != 2");
            return(false);
        }
        if (!SafeZoneEffectInstance.FastestModlues.m_effect_Play[0].m_MeshRender[0].sharedMaterial)
        {
            Debug.LogError("m_effect_Play[0].m_MeshRender[0].sharedMaterial is null");
            return(false);
        }

        if (!SafeZoneEffectInstance.FastestModlues.m_effect_Play[0].m_MeshRender[1].sharedMaterial)
        {
            Debug.LogError("m_effect_Play[0].m_MeshRender[1].sharedMaterial is null");
            return(false);
        }

        m_ZoneEffectMaterial = new Material[2];
        Material matTemp = SafeZoneEffectInstance.FastestModlues.m_effect_Play[0].m_MeshRender[0].sharedMaterial;

        if (matTemp.shader.name.Contains("VirusZone"))
        {
            mainZoneMaterialIndex = 0;
        }
        else
        {
            mainZoneMaterialIndex = 1;
        }
        m_ZoneEffectMaterial[0] = SafeZoneEffectInstance.FastestModlues.m_effect_Play[0].m_MeshRender[0].sharedMaterial;
        m_ZoneEffectMaterial[1] = SafeZoneEffectInstance.FastestModlues.m_effect_Play[0].m_MeshRender[1].sharedMaterial;

        m_ZoneEffectThickNess = new MaterialThickNess[2];

        m_ZoneEffectThickNess[mainZoneMaterialIndex].minThickNess_1 = new Vector2(10, 10);
        m_ZoneEffectThickNess[mainZoneMaterialIndex].maxThickNess_1 = new Vector2(100, 100);

        m_ZoneEffectThickNess[mainZoneMaterialIndex].minThickNess_2 = new Vector2(10, 10);
        m_ZoneEffectThickNess[mainZoneMaterialIndex].maxThickNess_2 = new Vector2(200, 200);

        isCanModifyMaterialThickNess = true;
        return(true);
    }
Пример #5
0
    /// <summary>
    /// 设置光效的碰撞层
    /// </summary>
    /// <param name="layer"></param>
    /// <param name="nod"></param>
    public static void SetEffectColliderLayer(int layer, Effect.EffectNode nod)
    {
        if (!nod)
        {
            return;
        }

        if (nod.effectColliders == null || nod.effectColliders.Length <= 0)
        {
            return;
        }

        foreach (Collider col in nod.effectColliders)
        {
            col.gameObject.layer = layer;
        }
    }
 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);
     }
 }
Пример #7
0
 public static void Clear()
 {
     AssetBundleManager.DeleteAssets(ref SafeZoneEffectRes, true);
     SafeZoneEffectInstance = null;
     SceneManager.UnRegisterSceneLoadFinishEvent(OnSceneLoadFinish);
 }