public override HeroState HandleInput(HeroMover hero, IInput input) { if (hero.IsReady2Kick2Left(input)) { return(new StateKick(toRight: false)); } if (hero.IsReady2Kick2Right(input)) { return(new StateKick(toRight: true)); } if (input.GetButtonDown(ButtonCode.Jump)) { if (hero.CanJumpInAir) { return(new StateJump(fromGround: false)); } } if (hero.KeyDirection == 1 && !right) { right = true; hero.SetAnim("fall"); } else if (hero.KeyDirection == -1 && right) { right = false; hero.SetAnim("fall"); } return(this); }
public override void Enter(HeroMover hero) { hero.MutekiManager.AddMutekiFilter("Jet"); hero.CanMove = false; hero.SetAnim("fall"); PhantomAndDissolve(hero); GameObject.Instantiate(hero.ObjsHolderForStates.JetstreamPrefab, DraftManager.CurrentInstance.GameMasterTF) .Init(hero); hero.GetDPinEnemy.GetComponent <Collider2D>().enabled = true; JetParams params_ = hero.Parameters.JetParams; float jetSeconds = Mathf.Lerp( params_.JetSecondsMin, params_.JetSecondsMax, charge_0_1 ); float jetDistance = Mathf.Lerp( params_.MinDistance, params_.MaxDistance, charge_0_1 ); hTween = new HeroTween( hero.WantsToGoRight ? jetDistance : -jetDistance, jetSeconds, hero.Parameters.JetParams.TweenLinearRate ); }
public override HeroState HandleInput(HeroMover hero, IInput input) { if (input.GetButtonDown(ButtonCode.Jump)) { return(new StateJump()); } if (!(input.GetButton(ButtonCode.Right) || input.GetButton(ButtonCode.Left))) { return(new StateWait()); } if (hero.KeyDirection == 1 && !right) { right = true; hero.SetAnim("run"); } if (hero.KeyDirection == -1 && right) { right = false; hero.SetAnim("run"); } return(this); }
void Init(HeroMover hero) { hero.SetAnim("run"); right = hero.WantsToGoRight; hero.SoundGroup.Play("Run"); }
public override void Enter(HeroMover hero) { hero.SetAnim("stand"); }
public override void Resume(HeroMover hero) { hero.SetAnim("stand"); }
void Start(HeroMover hero) { right = hero.WantsToGoRight; hero.SetAnim("fall"); }
void Start(HeroMover hero) { hero.SetAnim(hero.KeyDirection == 0 ? "jumpu" : "jumpf"); hero.SoundGroup.Play("Jump"); _dir = CalcDir(hero); }
public override void Resume(HeroMover hero) { hero.CanMove = false; hero.SetAnim("fall"); }
void Start_(HeroMover hero) { hero.CanMove = false; hero.SetAnim("bend"); }