Exemplo n.º 1
0
 public override void ExitState()
 {
     pandaContext.navmeshagent.enabled = true;
     pandaContext.transitioned         = true;
     pandaContext.transitioning        = false;
     pandaContext.Invincible(false);
 }
    public override void EnterState()
    {
        pandaContext.Invincible(true);
        pandaContext.navmeshagent.enabled = false;
        pandaContext.navmeshagent.speed  *= pandaContext.speedMultiplier;
        AkSoundEngine.PostEvent("Bear_Buff", pandaContext.gameObject);
        pandaContext.enemyanimation.SetTrigger("Transition");
        pandaContext.enemyanimation.SetFloat("AnimationSpeed", pandaContext.speedMultiplier);
        pandaContext.transitioning = true;
        jumpStart = pandaContext.transform.position;
        Vector3 directioToPlayer = PlayerController.Instance ? PlayerController.Instance.transform.position - pandaContext.Transform.position : Vector3.left;

        directioToPlayer.y = 0;
        jumpTarget         = pandaContext.transform.position + (Vector3.up + directioToPlayer.normalized) * pandaContext.meteorStartDistance;
    }