Exemplo n.º 1
0
        private void Start()
        {
            if (!usedByNPC)
            {
                audioSource  = GetComponent <AudioSource>();
                collisionTag = GetComponentInParent <GetCollisionTag>();
            }

            if (usedByNPC)
            {
                agent        = GetComponentInParent <NavMeshAgent>();
                collisionTag = GetComponent <GetCollisionTag>();
            }
        }
Exemplo n.º 2
0
        public void PlayFootstep()
        {
            switch (collisionTag.contactTag)
            {
            case "Dirt":
                AkSoundEngine.PostEvent(footstepsSFX, gameObject);
                break;

            case "Wood":
                AkSoundEngine.SetSwitch("footsteps", "wood", gameObject);
                AkSoundEngine.PostEvent(footstepsSFX, gameObject);
                collisionTagBuffer = collisionTag;
                break;

            case "Concrete":
                AkSoundEngine.SetSwitch("footsteps", "concrete", gameObject);
                AkSoundEngine.PostEvent(footstepsSFX, gameObject);
                collisionTagBuffer = collisionTag;
                break;

            case "Metal":
                AkSoundEngine.SetSwitch("footsteps", "metal", gameObject);
                AkSoundEngine.PostEvent(footstepsSFX, gameObject);
                collisionTagBuffer = collisionTag;
                break;

            case "Water":
                AkSoundEngine.SetSwitch("footsteps", "water", gameObject);
                AkSoundEngine.PostEvent(footstepsSFX, gameObject);
                collisionTagBuffer = collisionTag;
                break;

            case "Sand":
                AkSoundEngine.SetSwitch("footsteps", "sand", gameObject);
                AkSoundEngine.PostEvent(footstepsSFX, gameObject);
                collisionTagBuffer = collisionTag;
                break;

            default:
                AkSoundEngine.SetSwitch("footsteps", collisionTagBuffer.contactTag, gameObject);
                AkSoundEngine.PostEvent(footstepsSFX, gameObject);
                break;
            }
        }
Exemplo n.º 3
0
 private void Start()
 {
     collisionTag = GameObject.Find("Player").GetComponent <GetCollisionTag>();
 }