From 79ff94365b572d0e64ba945dcef2641ee508faa7 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 6 Nov 2020 20:41:04 +0800 Subject: =?UTF-8?q?*=E7=A9=BA=E4=B8=AD=E6=94=BB=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Actions/ActionEffects/ActionPlayEffect.cs | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs (limited to 'Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs') diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs new file mode 100644 index 00000000..6a00aaa8 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs @@ -0,0 +1,49 @@ +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); + } +} -- cgit v1.1-26-g67d0