summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs')
-rw-r--r--Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs49
1 files changed, 49 insertions, 0 deletions
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);
+ }
+}