示例#1
0
 void Start()
 {
     PlayerInverted.Singleton = this;
     _RjTimer = PlayerController.Singleton.DashTime;
     AddState(new PState(PlayerController.PlayerState.Idle));
     AddState(new WalkState());
     AddState(new HurtState());
     AddState(new JumpState());
     AddState(new DashState());
 }
示例#2
0
 public override void Run(PlayerInverted i)
 {
     if (DashTimer > 0)
     {
         DashTimer        -= Time.deltaTime;
         i.rb.gravityScale = 0.0f;
         i.rb.velocity     = new Vector2(Mathf.Lerp(Mathf.Abs(i.rb.velocity.x), PlayerController.Singleton.DashSpeed, Time.deltaTime * 3f) * PlayerController.Singleton.Movement, i.rb.velocity.y);
         i.DashPar.Play();
     }
 }
示例#3
0
 public override void Run(PlayerInverted i)
 {
     if (i.rb.velocity.y > 20)
     {
         i.rb.velocity = new Vector2(i.rb.velocity.x, 20f);
     }
     else
     {
         i.rb.AddForce(Vector2.down * PlayerController.Singleton.JumpForce);
     }
 }
示例#4
0
 public override void Run(PlayerInverted i)
 {
     if (Mathf.Abs(i.transform.position.x - FallPos.x) >= 10 || Mathf.Abs(i.rb.velocity.x) <= 0f)
     {
         i.SetState(PlayerController.PlayerState.Idle);
     }
     else
     {
         i.rb.AddForce(Vector2.left * 100);
     }
 }
示例#5
0
 public virtual void OnStart(PlayerInverted i)
 {
     foreach (AnimatorControllerParameter parameter in i._animator.parameters)
     {
         if (parameter.name == TriggerName)
         {
             i._animator.SetBool(TriggerName, true);
         }
         else
         {
             i._animator.SetBool(parameter.name, false);
         }
     }
 }
示例#6
0
 public override void OnEnd(PlayerInverted i)
 {
     DashTimer         = PlayerController.Singleton.DashTime;
     i.rb.velocity     = new Vector2(0, i.rb.velocity.y);
     i.rb.gravityScale = i._gravity;
 }
示例#7
0
 public override void OnStart(PlayerInverted i)
 {
     base.OnStart(i);
     DashTimer = PlayerController.Singleton.DashTime;
 }
示例#8
0
 public override void OnEnd(PlayerInverted i)
 {
     i.rb.velocity = new Vector2(0, i.rb.velocity.y);
 }
示例#9
0
 public override void Run(PlayerInverted i)
 {
     i.rb.velocity = new Vector2(Mathf.Lerp(Mathf.Abs(i.rb.velocity.x), PlayerController.Singleton.WalkSpeed, Time.deltaTime * 4f) * PlayerController.Singleton.Movement, i.rb.velocity.y);
 }
示例#10
0
 public override void OnStart(PlayerInverted i)
 {
     base.OnStart(i);
     FallPos = i.transform.position;
 }
示例#11
0
 public virtual void OnEnd(PlayerInverted i)
 {
 }
示例#12
0
 public virtual void Run(PlayerInverted i)
 {
 }