private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         hintsManager.ShowHintPanel(hintName, duration);
         Destroy(this.gameObject);
     }
 }
Exemple #2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            //Debug.Log("Player Entered");
            switch (voiceCommands)
            {
            case VoiceCommands.SurroundedByEnemies:
                if (playerHasEntered == false)
                {
                    hintsManager.ShowHintPanel("move", 5f);
                    audioManager.PlayVoiceCommand("SurroundedByEnemies");
                    playerHasEntered = true;
                }
                else
                {
                    return;
                }
                break;

            case VoiceCommands.DestroyHuts:
                if (playerHasEntered == false)
                {
                    audioManager.PlayVoiceCommand("DestroyHuts");
                    playerHasEntered = true;
                }
                else
                {
                    return;
                }
                break;

            case VoiceCommands.ShootFence:
                if (playerHasEntered == false)
                {
                    audioManager.PlayVoiceCommand("ShootFence");
                    playerHasEntered = true;
                }
                else
                {
                    return;
                }
                break;

            case VoiceCommands.WireCutters:
                if (playerHasEntered == false)
                {
                    audioManager.PlayVoiceCommand("WireCutters");
                    playerHasEntered = true;
                }
                else
                {
                    return;
                }
                break;

            case VoiceCommands.None:
                break;
            }
        }
        else
        {
            return;
        }
    }