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()); }
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(); } }
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); } }
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); } }
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); } } }
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; }
public override void OnStart(PlayerInverted i) { base.OnStart(i); DashTimer = PlayerController.Singleton.DashTime; }
public override void OnEnd(PlayerInverted i) { i.rb.velocity = new Vector2(0, i.rb.velocity.y); }
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); }
public override void OnStart(PlayerInverted i) { base.OnStart(i); FallPos = i.transform.position; }
public virtual void OnEnd(PlayerInverted i) { }
public virtual void Run(PlayerInverted i) { }