From 3708d0a07ce43c3d98a0171eacfa9c370c873f96 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 2 Nov 2020 19:53:12 +0800 Subject: =?UTF-8?q?*=E5=8F=97=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Test/SaionjiScript_Ability.cs | 45 +++++++++++++++------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'Assets/Scripts/Test/SaionjiScript_Ability.cs') diff --git a/Assets/Scripts/Test/SaionjiScript_Ability.cs b/Assets/Scripts/Test/SaionjiScript_Ability.cs index 8934b5da..d8233f56 100644 --- a/Assets/Scripts/Test/SaionjiScript_Ability.cs +++ b/Assets/Scripts/Test/SaionjiScript_Ability.cs @@ -4,10 +4,6 @@ using UnityEngine; public partial class SaionjiScript : Avatar { - /// - /// ability system - /// - AbilitySystem m_AbilitySystem = new AbilitySystem(); ConditionBase Not(ConditionBase cond) { @@ -19,7 +15,6 @@ public partial class SaionjiScript : Avatar return new ConditionAnd(c1, c2); } - ConditionBase Ands(params ConditionBase[] cond) { List conditions = new List(); @@ -71,13 +66,21 @@ public partial class SaionjiScript : Avatar AttackAbilityConfig config; - //招式会绑定一个motion + //招式会绑定一个motion + HitDefination hitDef = new HitDefination + { + }; AttackAbility attk1 = new AttackAbility(animator, Anim_LightAttack1, m_Body); - AttackAbility attk2 = new AttackAbility(animator, Anim_LightAttack2, m_Body); - AttackAbility attk3 = new AttackAbility(animator, Anim_LightAttack3, m_Body); - AttackAbility attk4 = new AttackAbility(animator, Anim_LightAttack4, m_Body); - AttackAbility attk5 = new AttackAbility(animator, Anim_LightAttack5, m_Body); - AttackAbility attkRush = new AttackAbility(animator, Anim_LightAttackRush, m_Body); + attk1.AddHitDefination(hitDef); + AttackAbility attk2 = new AttackAbility(animator, Anim_LightAttack2, m_Body); + attk2.AddHitDefination(hitDef); + AttackAbility attk3 = new AttackAbility(animator, Anim_LightAttack3, m_Body); + attk3.AddHitDefination(hitDef); + AttackAbility attk4 = new AttackAbility(animator, Anim_LightAttack4, m_Body); + attk4.AddHitDefination(hitDef); + AttackAbility attk5 = new AttackAbility(animator, Anim_LightAttack5, m_Body); + attk5.AddHitDefination(hitDef); + AttackAbility attkRush = new AttackAbility(animator, Anim_LightAttackRush, m_Body); config = new AttackAbilityConfig() { animator = this.animator, @@ -164,7 +167,7 @@ public partial class SaionjiScript : Avatar //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // idle ability - trigger = new Trigger(condUpCmd, toJump) ; + trigger = new Trigger(condTriangleCmd, toJump) ; idle.AddTrigger(trigger); trigger = new Trigger(And(condTowardRight, condDRC), new List { wipeCmdRecord, switchToSuperKick }); idle.AddTrigger(trigger); @@ -187,10 +190,12 @@ public partial class SaionjiScript : Avatar idle.AddTrigger(triggerTurnRight); idle.AddTrigger(triggerTurnLeft); - // move ability - trigger = new Trigger(Or(Ands(condRightButtonHold, condTowardRight, condUpCmd), Ands(condLeftButtonHold, condTowardLeft, condUpCmd)), toJumpForward); - move.AddTrigger(trigger); - trigger = new Trigger(And(condTowardRight, And(condRightCmd, condRight2Cmd)), new List { wipeCmdRecord, switchToDash, }); + // move ability + //trigger = new Trigger(Or(Ands(condRightButtonHold, condTowardRight, condTriangleCmd), Ands(condLeftButtonHold, condTowardLeft, condTriangleCmd)), toJumpForward); + //move.AddTrigger(trigger); + trigger = new Trigger(condTriangleCmd, toJump); + move.AddTrigger(trigger); + trigger = new Trigger(And(condTowardRight, And(condRightCmd, condRight2Cmd)), new List { wipeCmdRecord, switchToDash, }); move.AddTrigger(trigger); trigger = new Trigger(And(condTowardLeft, And(condLeftCmd, condLeft2Cmd)), new List { wipeCmdRecord, switchToDash }); move.AddTrigger(trigger); @@ -217,8 +222,8 @@ public partial class SaionjiScript : Avatar jump.AddTrigger(trigger); trigger = new Trigger(And(condLeftButtonHold, condCheckJump), new List { towardLeft, new ActionSetVelocityX(m_Body,-4) }, TriggerOnlyOnce.Off, TriggerSwallow.Off); jump.AddTrigger(trigger); - trigger = new Trigger(Ands(condCheckJump, Not(condRightButtonHold), Not(condLeftButtonHold)), new ActionSetVelocityX(m_Body, 0), TriggerOnlyOnce.Off, TriggerSwallow.Off); - jump.AddTrigger(trigger); + //trigger = new Trigger(Ands(condCheckJump, Not(condRightButtonHold), Not(condLeftButtonHold)), new ActionSetVelocityX(m_Body, 0), TriggerOnlyOnce.Off, TriggerSwallow.Off); + //jump.AddTrigger(trigger); trigger = new Trigger(condJumpOnGround, new ActionSetVelocity(m_Body, Vector3.zero), TriggerOnlyOnce.On, TriggerSwallow.Off); jump.AddTrigger(trigger); trigger = new Trigger(Ands(new ConditionJumpDone(jump, 0.4f), condJumpOnGround, Or(condRightButtonHold, condLeftButtonHold)), switchToMove); @@ -244,8 +249,8 @@ public partial class SaionjiScript : Avatar attk1.AddTrigger(trigger); attk1.AddTrigger(triggerTurnRight); attk1.AddTrigger(triggerTurnLeft); - trigger = new Trigger(condIsHit, new ActionLog("hit!!!")); - attk1.AddLateTrigger(trigger); + //trigger = new Trigger(condIsHit, new ActionLog("hit!!!")); + //attk1.AddLateTrigger(trigger); //ConditionMotionRange condAttkRushGhostRange = new ConditionMotionRange(animator, 0f, 0.8f); //trigger = new Trigger(condAttkRushGhostRange, enableGhost, false); -- cgit v1.1-26-g67d0