using System.Collections; using System.Collections.Generic; using UnityEngine; // 播放特效 public class ActionPlayEffect : ActionBase { enum Type { GivenPosition, // 固定位置 FollowObject, // 动态位置 Avatar, // 角色 } Type m_Type; string m_Effect; Vector3 m_Position; Vector3 m_Rotation; Vector3 m_Scale; Transform m_Follow; Avatar m_Avatar; public ActionPlayEffect(string effect, Vector3 position, Vector3 rotation, Vector3 scale) { } public ActionPlayEffect(string effect, Transform followPosition, Vector3 rotation, Vector3 scale) { } public ActionPlayEffect(string effect, Avatar avatar, Vector3 rotation, Vector3 scale) { m_Type = Type.Avatar; m_Effect = effect; m_Avatar = avatar; m_Rotation = rotation; m_Scale = scale; } public override void Execute() { if (m_Type == Type.Avatar) m_Position = m_Avatar.GetEffectPosition(); EffectsManager.Instance.PlayEffect(m_Effect, m_Position, m_Rotation, m_Scale); } }