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 --- Assets/Scripts/Avatar/Abilities/AttackAbility.cs | 5 ++ Assets/Scripts/Avatar/Abilities/IdleAbility.cs | 7 ++- Assets/Scripts/Avatar/Abilities/MoveAbility.cs | 5 ++ Assets/Scripts/Avatar/Actions/ActionEffects.meta | 8 +++ .../ActionEffects/ActionActivateAfterImage.cs | 18 ++++++ .../ActionEffects/ActionActivateAfterImage.cs.meta | 11 ++++ .../ActionEffects/ActionAfterImageInterval.cs | 18 ++++++ .../ActionEffects/ActionAfterImageInterval.cs.meta | 11 ++++ .../Actions/ActionEffects/ActionPlayEffect.cs | 49 +++++++++++++++ .../Actions/ActionEffects/ActionPlayEffect.cs.meta | 11 ++++ Assets/Scripts/Avatar/Avatar.cs | 5 ++ Assets/Scripts/Avatar/Trigger.cs | 21 +++++-- Assets/Scripts/Effects/AfterImage/AfterImage.cs | 3 - .../Scripts/Effects/AfterImage/AfterImagePool.cs | 27 ++++++-- Assets/Scripts/Effects/Effect.cs | 30 +++++++++ Assets/Scripts/Effects/Effect.cs.meta | 11 ++++ Assets/Scripts/Effects/EffectsManager.cs | 73 ++++++++++++++++++++++ Assets/Scripts/Effects/EffectsManager.cs.meta | 11 ++++ Assets/Scripts/Props.meta | 8 +++ Assets/Scripts/Test/SaionjiScript_Ability.cs | 34 ++++++---- Assets/Scripts/Test/SaionjiScript_Effect.cs | 13 ++++ Assets/Scripts/Test/SaionjiScript_Effect.cs.meta | 11 ++++ 22 files changed, 365 insertions(+), 25 deletions(-) create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects.meta create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs create mode 100644 Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta create mode 100644 Assets/Scripts/Effects/Effect.cs create mode 100644 Assets/Scripts/Effects/Effect.cs.meta create mode 100644 Assets/Scripts/Effects/EffectsManager.cs create mode 100644 Assets/Scripts/Effects/EffectsManager.cs.meta create mode 100644 Assets/Scripts/Props.meta create mode 100644 Assets/Scripts/Test/SaionjiScript_Effect.cs create mode 100644 Assets/Scripts/Test/SaionjiScript_Effect.cs.meta (limited to 'Assets/Scripts') diff --git a/Assets/Scripts/Avatar/Abilities/AttackAbility.cs b/Assets/Scripts/Avatar/Abilities/AttackAbility.cs index 57e9541b..5a200cf8 100644 --- a/Assets/Scripts/Avatar/Abilities/AttackAbility.cs +++ b/Assets/Scripts/Avatar/Abilities/AttackAbility.cs @@ -85,6 +85,11 @@ public class AttackAbility : AbilityBase { hit.WipeRecords(); } + + foreach(var trigger in m_Triggers) + { + trigger.Reset(); + } } public override void OnExit() diff --git a/Assets/Scripts/Avatar/Abilities/IdleAbility.cs b/Assets/Scripts/Avatar/Abilities/IdleAbility.cs index d42308db..e692cc2a 100644 --- a/Assets/Scripts/Avatar/Abilities/IdleAbility.cs +++ b/Assets/Scripts/Avatar/Abilities/IdleAbility.cs @@ -24,7 +24,12 @@ public class IdleAbility : AbilityBase public override void OnEnter() { m_Animator.CrossFadeInFixedTime(m_AnimHash, 0.25f); - } + + foreach (var trigger in m_Triggers) + { + trigger.Reset(); + } + } public override void OnInit() { diff --git a/Assets/Scripts/Avatar/Abilities/MoveAbility.cs b/Assets/Scripts/Avatar/Abilities/MoveAbility.cs index cf9fa106..61efd0cf 100644 --- a/Assets/Scripts/Avatar/Abilities/MoveAbility.cs +++ b/Assets/Scripts/Avatar/Abilities/MoveAbility.cs @@ -31,6 +31,11 @@ public class MoveAbility : AbilityBase public override void OnEnter() { m_Animator.CrossFadeInFixedTime(m_AnimHash, 0.1f); + + foreach (var trigger in m_Triggers) + { + trigger.Reset(); + } } public override void OnExit() diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects.meta b/Assets/Scripts/Avatar/Actions/ActionEffects.meta new file mode 100644 index 00000000..17a426dd --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b5ccfefc2e6b104a8566f4da9a16c5f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs new file mode 100644 index 00000000..0b2ac361 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ActionActivateAfterImage : ActionBase +{ + private bool m_IsActive; + + public ActionActivateAfterImage(bool isActive) + { + m_IsActive = isActive; + } + + public override void Execute() + { + AfterImagePool.Instance.Activate(m_IsActive); + } +} diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta new file mode 100644 index 00000000..189e2f24 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8df8331b2b9416b499e856b691c2326e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs new file mode 100644 index 00000000..1d5c2f8b --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ActionAfterImageInterval : ActionBase +{ + private int m_Interval; + + public ActionAfterImageInterval(int interval) + { + m_Interval = interval; + } + + public override void Execute() + { + AfterImagePool.Instance.SetInterval(m_Interval); + } +} diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta new file mode 100644 index 00000000..fa144bad --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e87b2df9fee7956449df7dc2d430b862 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: 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); + } +} diff --git a/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta new file mode 100644 index 00000000..0e085fc4 --- /dev/null +++ b/Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca4c24da837b8854f8510118217e063d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Avatar/Avatar.cs b/Assets/Scripts/Avatar/Avatar.cs index a8d90fa7..928d2197 100644 --- a/Assets/Scripts/Avatar/Avatar.cs +++ b/Assets/Scripts/Avatar/Avatar.cs @@ -131,4 +131,9 @@ public class Avatar : MonoBehaviour, IInteractable m_AbilitySystem.OnLateUpdate(); } + public virtual Vector3 GetEffectPosition() + { + return Vector3.zero; + } + } diff --git a/Assets/Scripts/Avatar/Trigger.cs b/Assets/Scripts/Avatar/Trigger.cs index 70a6d0f4..a885327c 100644 --- a/Assets/Scripts/Avatar/Trigger.cs +++ b/Assets/Scripts/Avatar/Trigger.cs @@ -31,17 +31,23 @@ public sealed class Trigger } private ConditionBase m_Condition; - private List m_ActionChain = new List(); - + private List m_ActionChain = new List(); + + private TriggerOnlyOnce m_OnlyOnce; + + private bool m_IsTriggered; + public Trigger(ConditionBase condition, List actions, TriggerOnlyOnce onlyOnce = TriggerOnlyOnce.Off, TriggerSwallow swallow = TriggerSwallow.On) { - m_Swallow = swallow; + m_OnlyOnce = onlyOnce; + m_Swallow = swallow; m_Condition = condition; m_ActionChain.AddRange(actions); } public Trigger(ConditionBase condition, ActionBase action, TriggerOnlyOnce onlyOnce = TriggerOnlyOnce.Off, TriggerSwallow swallow = TriggerSwallow.On) { - m_Swallow = swallow; + m_OnlyOnce = onlyOnce; + m_Swallow = swallow; m_Condition = condition; m_ActionChain.Add(action); } @@ -49,8 +55,8 @@ public sealed class Trigger //重置触发器的参数 public void Reset() { - - } + m_IsTriggered = false; + } /// /// 如果触发执行了,返回true,否则返回false @@ -58,12 +64,15 @@ public sealed class Trigger /// public bool Update() { + if (m_IsTriggered && m_OnlyOnce == TriggerOnlyOnce.On) + return false; if (m_Condition.Evaluate()) { foreach(var action in m_ActionChain) { action.Execute(); } + m_IsTriggered = true; return true; } return false; diff --git a/Assets/Scripts/Effects/AfterImage/AfterImage.cs b/Assets/Scripts/Effects/AfterImage/AfterImage.cs index 445a16c2..123c0300 100644 --- a/Assets/Scripts/Effects/AfterImage/AfterImage.cs +++ b/Assets/Scripts/Effects/AfterImage/AfterImage.cs @@ -48,9 +48,6 @@ public class AfterImage : MonoBehaviour { for(int i = 0;i < renderer.materials.Length; ++i) { - renderer.materials[i].SetColor("_Color", Color.red); - renderer.materials[i].SetColor("_Color1", Color.white); - renderer.materials[i].SetColor("_Color2", Color.white); renderer.materials[i].SetFloat("_Intensity", intensity); renderer.materials[i].SetFloat("_MKGlowPower", intensity); } diff --git a/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs b/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs index 8b32fe38..38d3488d 100644 --- a/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs +++ b/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs @@ -4,9 +4,10 @@ using UnityEngine; public class AfterImagePool : MonoBehaviour { - - //public CharacterControl myCharacterControl; - public GameObject targetObject; //Set these manually to the character object you're copying + public static AfterImagePool Instance; + + //public CharacterControl myCharacterControl; + public GameObject targetObject; //Set these manually to the character object you're copying public Animator targetAnimator; //Set these manually to the character object you're copying public GameObject prefab; //This is the prefab you made in the scene. It's a parent transform with an animator and AfterImage script on it, with Armature and SkinnedMeshRenderer children public int poolSize = 10; @@ -16,6 +17,8 @@ public class AfterImagePool : MonoBehaviour public int time = 0; + private bool isActive = false; + // Use this for initialization void Start() { @@ -32,13 +35,17 @@ public class AfterImagePool : MonoBehaviour afterImages.Add(nextAfterImage.GetComponent()); } + Instance = this; } // Update is called once per frame void Update() { + if (!isActive) + return; + time++; - if (time > interval) + if (time >= interval) { time = 0; AddAfterImage(); @@ -56,4 +63,16 @@ public class AfterImagePool : MonoBehaviour } } } + + public void Activate(bool isActive) + { + this.isActive = isActive; + time = isActive ? interval : 0; + } + + public void SetInterval(int interval) + { + this.interval = interval; + } + } \ No newline at end of file diff --git a/Assets/Scripts/Effects/Effect.cs b/Assets/Scripts/Effects/Effect.cs new file mode 100644 index 00000000..a8f0d37f --- /dev/null +++ b/Assets/Scripts/Effects/Effect.cs @@ -0,0 +1,30 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Effect : MonoBehaviour +{ + public string Name; + public float LifeTime; + + private float time; + + private void Awake() + { + } + + private void OnEnable() + { + time = 0; + } + + private void Update() + { + time += Time.deltaTime; + if(time > LifeTime) + { + EffectsManager.Instance.CycleEffect(this); + } + } + +} diff --git a/Assets/Scripts/Effects/Effect.cs.meta b/Assets/Scripts/Effects/Effect.cs.meta new file mode 100644 index 00000000..ea99b00a --- /dev/null +++ b/Assets/Scripts/Effects/Effect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0f48b3d527ef6c49999e8a4b9892cd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Effects/EffectsManager.cs b/Assets/Scripts/Effects/EffectsManager.cs new file mode 100644 index 00000000..f62b0bdb --- /dev/null +++ b/Assets/Scripts/Effects/EffectsManager.cs @@ -0,0 +1,73 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System; + +public class EffectsManager : MonoBehaviour +{ + public static EffectsManager Instance; + + public Effect[] EffectTemplates; + + public Transform Root_Pool; + + List m_Pool = new List(); + + private void Awake() + { + Instance = this; + } + + Effect GetEffectTemplate(string name) + { + foreach(var effect in EffectTemplates) + { + if(effect != null && effect.Name == name) + { + return effect; + } + } + return null; + } + + Effect RecycleEffect(string name) + { + foreach(var effect in m_Pool) + { + if (effect != null && effect.Name == name) + { + return effect; + } + } + return null; + } + + public void PlayEffect(string name, Vector3 position, Vector3 rotation, Vector3 scale) + { + Effect effect = RecycleEffect(name); + if(effect == null) + { + Effect temp = GetEffectTemplate(name); + effect = UnityEngine.Object.Instantiate(temp); + } + else + { + m_Pool.Remove(effect); + } + + effect.transform.position = position; + effect.transform.rotation = Quaternion.Euler(rotation); + effect.transform.localScale = scale; + effect.transform.SetParent(this.transform); + effect.gameObject.SetActive(true); + } + + // 回收特效 + public void CycleEffect(Effect effect) + { + effect.gameObject.SetActive(false); + effect.transform.SetParent(Root_Pool); + m_Pool.Add(effect); + } + +} diff --git a/Assets/Scripts/Effects/EffectsManager.cs.meta b/Assets/Scripts/Effects/EffectsManager.cs.meta new file mode 100644 index 00000000..b8dd8f96 --- /dev/null +++ b/Assets/Scripts/Effects/EffectsManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db461c57209f8a241a28d33730ad12ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Props.meta b/Assets/Scripts/Props.meta new file mode 100644 index 00000000..bb96602e --- /dev/null +++ b/Assets/Scripts/Props.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f299520ed9fcf4a45858ad4ef5a8d5d1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Test/SaionjiScript_Ability.cs b/Assets/Scripts/Test/SaionjiScript_Ability.cs index 665b787c..ae211b89 100644 --- a/Assets/Scripts/Test/SaionjiScript_Ability.cs +++ b/Assets/Scripts/Test/SaionjiScript_Ability.cs @@ -136,10 +136,15 @@ public partial class SaionjiScript : Avatar ActionEffectGhost enableGhost = new ActionEffectGhost(Effects[0] as CharacterGhostEffect); ActionDisableGhost disableGhost = new ActionDisableGhost(Effects[0] as CharacterGhostEffect); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // conditions - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ConditionCommand condLeftCmd = new ConditionCommand(GamepadButton.Left); + ActionActivateAfterImage enableAfterImage = new ActionActivateAfterImage(true); + ActionActivateAfterImage disaleAfterImage = new ActionActivateAfterImage(false); + ActionAfterImageInterval smallAfterImageInterval = new ActionAfterImageInterval(2); + ActionAfterImageInterval midiumAfterImageInterval = new ActionAfterImageInterval(5); + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // conditions + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + ConditionCommand condLeftCmd = new ConditionCommand(GamepadButton.Left); ConditionCommand condRightCmd = new ConditionCommand(GamepadButton.Right); ConditionNoMoveButtonHold condNoMoveButtonHold = new ConditionNoMoveButtonHold(); ConditionButtonHold condRightButtonHold = new ConditionButtonHold(GamepadButton.Right); @@ -226,11 +231,11 @@ public partial class SaionjiScript : Avatar move.AddTrigger(trigger); // jump ability - trigger = new Trigger(Ands(condInAir, condRightCmd, condRight2Cmd), new List { towardRight, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(25, 0, 0)), new ActionDontUseGravity(m_Body) }); + trigger = new Trigger(Ands(condInAir, condRightCmd, condRight2Cmd), new List { towardRight, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(25, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, midiumAfterImageInterval}); jump.AddTrigger(trigger); - trigger = new Trigger(Ands(condInAir, condLeftCmd, condLeft2Cmd), new List { towardLeft, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(-25, 0, 0)), new ActionDontUseGravity(m_Body) }); + trigger = new Trigger(Ands(condInAir, condLeftCmd, condLeft2Cmd), new List { towardLeft, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(-25, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, midiumAfterImageInterval }); jump.AddTrigger(trigger); - trigger = new Trigger(Ands(condInAir, condCircleCmd), new List { switchToAirAttk1, new ActionSetLocalVelocity(m_Body, new Vector3(0, 0, 0)), new ActionDontUseGravity(m_Body)}); + trigger = new Trigger(Ands(condInAir, condCircleCmd), new List { switchToAirAttk1, new ActionSetLocalVelocity(m_Body, new Vector3(0, 0, 0)), new ActionDontUseGravity(m_Body), enableAfterImage, smallAfterImageInterval}); jump.AddTrigger(trigger); ConditionCheckJumpState condCheckJump = new ConditionCheckJumpState(jump, JumpAbility.State.None, JumpAbility.Direction.Neutral); trigger = new Trigger(And(condRightButtonHold, condCheckJump), new List { towardRight, new ActionSetVelocityX(m_Body, 4)}, TriggerOnlyOnce.Off, TriggerSwallow.Off); @@ -376,14 +381,21 @@ public partial class SaionjiScript : Avatar trigger = new Trigger(And(condGun4MotionRange, condLeft2Cmd), new List { switchToDash, towardLeft }); gun4.AddTrigger(trigger); - // air dash - trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirDash), new List { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump }); + // air dash + trigger = new Trigger(new ConditionMotionRange(animator, 0.8f, 1f), disaleAfterImage, TriggerOnlyOnce.On, TriggerSwallow.Off); + airDash.AddTrigger(trigger); + trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirDash), new List { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump }); airDash.AddTrigger(trigger); - trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirAttack1), new List { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump }); + trigger = new Trigger(new ConditionMotionRange(animator, 0.18f, 1f), new ActionPlayEffect("Air_Attk1", this, new Vector3(-136.805f, 0, 0), new Vector3(0.8f, 0.8f, 0.8f)), TriggerOnlyOnce.On, TriggerSwallow.Off); + airAttk1.AddTrigger(trigger); + trigger = new Trigger(new ConditionMotionRange(animator, 0.6f,1f), disaleAfterImage, TriggerOnlyOnce.On, TriggerSwallow.Off); + airAttk1.AddTrigger(trigger); + trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirAttack1), new List { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump}); airAttk1.AddTrigger(trigger); + airAttk1.AddHitDefination(hitDef); - m_AbilitySystem.ForceStart(idle); + m_AbilitySystem.ForceStart(idle); } } \ No newline at end of file diff --git a/Assets/Scripts/Test/SaionjiScript_Effect.cs b/Assets/Scripts/Test/SaionjiScript_Effect.cs new file mode 100644 index 00000000..f07ce915 --- /dev/null +++ b/Assets/Scripts/Test/SaionjiScript_Effect.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public partial class SaionjiScript : Avatar +{ + public Transform m_Hips; + + public override Vector3 GetEffectPosition() + { + return m_Hips.position; + } +} diff --git a/Assets/Scripts/Test/SaionjiScript_Effect.cs.meta b/Assets/Scripts/Test/SaionjiScript_Effect.cs.meta new file mode 100644 index 00000000..d24fd6f2 --- /dev/null +++ b/Assets/Scripts/Test/SaionjiScript_Effect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 69ccf56f65f14b84a89682dbe0cdb58e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- cgit v1.1-26-g67d0