Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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
            );
    }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
 void Init(HeroMover hero)
 {
     hero.SetAnim("run");
     right = hero.WantsToGoRight;
     hero.SoundGroup.Play("Run");
 }
Esempio n. 5
0
 public override void Enter(HeroMover hero)
 {
     hero.SetAnim("stand");
 }
Esempio n. 6
0
 public override void Resume(HeroMover hero)
 {
     hero.SetAnim("stand");
 }
Esempio n. 7
0
 void Start(HeroMover hero)
 {
     right = hero.WantsToGoRight;
     hero.SetAnim("fall");
 }
Esempio n. 8
0
 void Start(HeroMover hero)
 {
     hero.SetAnim(hero.KeyDirection == 0 ? "jumpu" : "jumpf");
     hero.SoundGroup.Play("Jump");
     _dir = CalcDir(hero);
 }
Esempio n. 9
0
 public override void Resume(HeroMover hero)
 {
     hero.CanMove = false;
     hero.SetAnim("fall");
 }
Esempio n. 10
0
 void Start_(HeroMover hero)
 {
     hero.CanMove = false;
     hero.SetAnim("bend");
 }