summaryrefslogtreecommitdiff
path: root/Assets/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/Avatar/Abilities/AttackAbility.cs5
-rw-r--r--Assets/Scripts/Avatar/Abilities/IdleAbility.cs7
-rw-r--r--Assets/Scripts/Avatar/Abilities/MoveAbility.cs5
-rw-r--r--Assets/Scripts/Avatar/Actions/ActionEffects.meta8
-rw-r--r--Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs18
-rw-r--r--Assets/Scripts/Avatar/Actions/ActionEffects/ActionActivateAfterImage.cs.meta11
-rw-r--r--Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs18
-rw-r--r--Assets/Scripts/Avatar/Actions/ActionEffects/ActionAfterImageInterval.cs.meta11
-rw-r--r--Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs49
-rw-r--r--Assets/Scripts/Avatar/Actions/ActionEffects/ActionPlayEffect.cs.meta11
-rw-r--r--Assets/Scripts/Avatar/Avatar.cs5
-rw-r--r--Assets/Scripts/Avatar/Trigger.cs21
-rw-r--r--Assets/Scripts/Effects/AfterImage/AfterImage.cs3
-rw-r--r--Assets/Scripts/Effects/AfterImage/AfterImagePool.cs27
-rw-r--r--Assets/Scripts/Effects/Effect.cs30
-rw-r--r--Assets/Scripts/Effects/Effect.cs.meta11
-rw-r--r--Assets/Scripts/Effects/EffectsManager.cs73
-rw-r--r--Assets/Scripts/Effects/EffectsManager.cs.meta11
-rw-r--r--Assets/Scripts/Props.meta8
-rw-r--r--Assets/Scripts/Test/SaionjiScript_Ability.cs34
-rw-r--r--Assets/Scripts/Test/SaionjiScript_Effect.cs13
-rw-r--r--Assets/Scripts/Test/SaionjiScript_Effect.cs.meta11
22 files changed, 365 insertions, 25 deletions
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<ActionBase> m_ActionChain = new List<ActionBase>();
-
+ private List<ActionBase> m_ActionChain = new List<ActionBase>();
+
+ private TriggerOnlyOnce m_OnlyOnce;
+
+ private bool m_IsTriggered;
+
public Trigger(ConditionBase condition, List<ActionBase> 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;
+ }
/// <summary>
/// 如果触发执行了,返回true,否则返回false
@@ -58,12 +64,15 @@ public sealed class Trigger
/// <returns></returns>
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<AfterImage>());
}
+ 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<Effect> m_Pool = new List<Effect>();
+
+ 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<ActionBase> { towardRight, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(25, 0, 0)), new ActionDontUseGravity(m_Body) });
+ trigger = new Trigger(Ands(condInAir, condRightCmd, condRight2Cmd), new List<ActionBase> { 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<ActionBase> { towardLeft, switchToAirDash, new ActionSetVelocity(m_Body, new Vector3(-25, 0, 0)), new ActionDontUseGravity(m_Body) });
+ trigger = new Trigger(Ands(condInAir, condLeftCmd, condLeft2Cmd), new List<ActionBase> { 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<ActionBase> { switchToAirAttk1, new ActionSetLocalVelocity(m_Body, new Vector3(0, 0, 0)), new ActionDontUseGravity(m_Body)});
+ trigger = new Trigger(Ands(condInAir, condCircleCmd), new List<ActionBase> { 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<ActionBase> { 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<ActionBase> { switchToDash, towardLeft });
gun4.AddTrigger(trigger);
- // air dash
- trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirDash), new List<ActionBase> { 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<ActionBase> { new ActionSetVelocity(m_Body, Vector3.zero), new ActionUseGravity(m_Body), toJump });
airDash.AddTrigger(trigger);
- trigger = new Trigger(new ConditionMotionAtEnd(animator, Anim_AirAttack1), new List<ActionBase> { 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<ActionBase> { 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: