Ejemplo n.º 1
0
    }//PlayJumpAnimation


    public virtual void SetWallGrabTrigger() {
        if (AnimatorCmp == null)
            return;
        if (AnimatorCmp.GetAnimatorTransitionInfo(0).anyState)
            return;
        AnimatorCmp.SetTrigger(Props.OnWallGrabbed);
    }//PlayJumpAnimation
Ejemplo n.º 2
0
    }//SetBool


    public void SetTrigger(string name) {
        if(_animator == null)
            return;
        if (AnimatorCmp.GetAnimatorTransitionInfo(0).anyState)
            return;
        _animator.SetTrigger(name);
    }//SetTrigger
Ejemplo n.º 3
0
    }//PlayCritDamaged

    public virtual void PlayDeath()
    {
        int triggerIndex = Random.Range(0, this.Props.DieTrigger.Length);

        AnimatorCmp?.SetTrigger(this.Props.DieTrigger[triggerIndex]);
        AnimatorCmp?.SetBool(Props.Died, true);
    }//PlayDeath
Ejemplo n.º 4
0
    }//PlayJumpAnimation


    public virtual void SetDashedTrigger(AAbility ability) {
        if (AnimatorCmp == null)
            return;
        if(AnimatorCmp.GetAnimatorTransitionInfo(0).anyState)
            return;
        AnimatorCmp.SetTrigger(Props.Dashed);
    }//PlayJumpAnimation
Ejemplo n.º 5
0
    }//onWallStateInvoke


    private void onWallJumpInvoke(WallGrab cmp) {
        if (AnimatorCmp == null)
            return;
        if (cmp.IsBackflipJumping)
            AnimatorCmp.SetTrigger("Backflip");
        else
            AnimatorCmp.SetTrigger(this.Props.Jumped);
    }
Ejemplo n.º 6
0
    public virtual void PlayDamaged()
    {
        int max = Props.DamageReact.Length;

        if (max == 0)
        {
            return;
        }

        int randPick = Random.Range(0, max);

        AnimatorCmp?.SetTrigger(Props.DamageReact[randPick]);
    }//PlayDamagedAnimation
Ejemplo n.º 7
0
    }//PlayDamagedAnimation

    public virtual void PlayCritDamaged()
    {
        AnimatorCmp?.SetTrigger(Props.CritHitted);
    }//PlayCritDamaged
Ejemplo n.º 8
0
 public void TakeCritDamage(GameObject instigator, int amount)
 {
     this.PlayCritDamaged();
     AnimatorCmp?.SetBool("HadCrit", true);
 }
Ejemplo n.º 9
0
    }//SetWalking

    public void SetIdle(bool state)
    {
        AnimatorCmp?.SetBool(Props.Walking, !state);
        AnimatorCmp?.SetBool(Props.Idle, state);
    }//SetWalking
Ejemplo n.º 10
0
    }//SetVelocity


    public virtual void SetGrounded(bool state) {
        if (AnimatorCmp == null)
            return;
        AnimatorCmp.SetBool(this.Props.IsGrounded, state);
    }//SetVelocity
Ejemplo n.º 11
0
    }//PlayJumpAnimation


    public virtual void SetVelocity(float val) {
        if(AnimatorCmp == null)
            return;
        AnimatorCmp.SetFloat(this.Props.Speed, val);
    }//SetVelocity
Ejemplo n.º 12
0
    }//groundStateListenerInvoke


    private void velocityUpdateInvoke(Vector2 prevVelocity, Vector2 newVelocity) {
        if (AnimatorCmp == null)
            return;
        AnimatorCmp.SetFloat(this.Props.VelocityY, newVelocity.y);
    }//velocityUpdateInvoke
Ejemplo n.º 13
0
    }//SetTrigger


    public virtual void PlayJumpAnimation() {
        if(AnimatorCmp == null)
            return;
        AnimatorCmp.SetTrigger(Props.Jumped);
    }//PlayJumpAnimation
Ejemplo n.º 14
0
    }//start

    public void Update() {
        if (PlayerCmp.IsCanControl) {
            AnimatorCmp.StopPlayback();
        }
    }//update
Ejemplo n.º 15
0
    }//velocityUpdateInvoke


    private void onWallStateInvoke(WallGrab wallJumpCmp) {
        if (AnimatorCmp == null)
            return;
        AnimatorCmp.SetBool(this.Props.OnWall, wallJumpCmp.IsOnWall);
    }//onWallStateInvoke
Ejemplo n.º 16
0
    }//PlayDeath

    public void Reset()
    {
        //AnimatorCmp?.SetBool("HadCrit", false);
        AnimatorCmp?.Rebind();
    }
Ejemplo n.º 17
0
    }//SetVelocity


    public virtual void SetDashing(bool state) {
        if (AnimatorCmp == null)
            return;
        AnimatorCmp.SetBool(this.Props.Dashing, state);
    }//SetVelocity