| | |
| | | |
| | | public GameObjectPoolManager.GameObjectPool pool; |
| | | |
| | | public BattleField battleField; |
| | | |
| | | public Action onComplete; |
| | | |
| | | private bool isPlaying = false; |
| | |
| | | { |
| | | PlayUnityEffect(); |
| | | } |
| | | |
| | | battleField?.soundManager.PlayEffectSound(effectConfig.audio); |
| | | |
| | | OnAlphaChanged(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | // 创建后的特效会自动隐藏 需要手动调用Play才能播放 |
| | | public static BattleEffectPlayer Create(int effectId, Transform parent, bool isRedCamp) |
| | | public static BattleEffectPlayer Create(int effectId, BattleField _battleField, Transform parent, bool isRedCamp) |
| | | { |
| | | // 直接创建特效播放器,不使用对象池 |
| | | BattleEffectPlayer battleEffectPlayer = null; |
| | |
| | | GameObject newGo = new GameObject("BattleEffectPlayer_" + effectId); |
| | | newGo.transform.SetParent(parent, false); |
| | | battleEffectPlayer = newGo.AddComponent<BattleEffectPlayer>(); |
| | | battleEffectPlayer.battleField = _battleField; |
| | | battleEffectPlayer.rectTrans = newGo.AddMissingComponent<RectTransform>(); |
| | | |
| | | battleEffectPlayer.effectId = effectId; |