Exemplo n.º 1
0
 public void Click()
 {
     if (IsInteractive())
     {
         soundPlayer.GetComponent <SoundPlayer>().Play(normalPressSound);
         IsUsed = true;
         gameplayManager.OnClicked(row, column);
         UpdateLook();
         HoverOff();
         helpMessageManager.GetComponent <HelpMessageManager>().DisplayMessage(usedHelpMessage);
     }
     else
     {
         soundPlayer.GetComponent <SoundPlayer>().Play(usedPressSound);
     }
 }
Exemplo n.º 2
0
    void playAlert()
    {
        if (timeSincePlayed < 2.0f)
        {
            return;
        }
        timeSincePlayed = 0.0f;
        //play alert sound
        //NOTE:has to have an audioSource component!!!
        AudioSource audio = soundPlayerScript.GetComponent <AudioSource>();

        audio.clip = Resources.Load <AudioClip>("alert");
        audio.Play();
    }
Exemplo n.º 3
0
 void Start()
 {
     _soundPlayer = FindObjectOfType <SoundPlayer>();
     _audioSource = _soundPlayer.GetComponent <AudioSource>();
 }