Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var ZombieIntelligence : ZombieAI ;
- var animator : Animator ;
- function Start () {
- ZombieIntelligence = gameObject.GetComponent ( ZombieAI ) ;
- animator = GetComponent ( Animator ) ;
- }
- function Update () {
- if ( ZombieIntelligence.Zombie.Kombat.State.Walking )
- {
- //animation.Play ( "walk" );
- }else if ( ZombieIntelligence.Zombie.Kombat.State.Attacking )
- {
- //animation.Play ( "attack1" ) ;
- //animation["attack1"].wrapMode = WrapMode.Loop ;
- if ( Mathf.Ceil ( animator.GetFloat ( "CoolDown" ) ) == 0 )
- {
- animator.SetBool ( "Attacking", true ) ;
- animator.SetFloat ( "CoolDown", 3 ) ;
- }else {
- animator.SetBool ( "Attacking", false ) ;
- }
- //animator.SetBool ( "Attacking", false );
- }else if ( ZombieIntelligence.Zombie.Kombat.State.Running )
- {
- //animation.Play ( "walk" ) ;
- }else if ( ZombieIntelligence.Zombie.Kombat.State.Dying )
- {
- //animation.Play ( "ZombieDeath" ) ;
- }
- if ( animator.GetFloat ( "CoolDown" ) > 0 )
- {
- animator.SetFloat ( "CoolDown", animator.GetFloat ( "CoolDown") - ( 1 * Time.deltaTime ) ) ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement