/// <summary> /// Toggles the mute. /// </summary> public void ToggleMute() { //_audio.volume = ( _audio.volume > 0 ) ? 0 : 1.0f; if (_audio.isPlaying == true) { _audio.Stop(); PlayerNotoriety.DecreasePlayerNotoriety(); } else { int i = Random.Range(0, 9); i = (i > 4) ? 1 : 0; //Debug.Log("Random Index of Clips is: " + i); _audio.clip = backgroundPartyMusicClips[i]; _audio.Play(); PlayerNotoriety.IncreasePlayerNotoriety(); } //if (_audio.volume > 0) //{ // int i = Random.Range(0, 1); // _audio.clip = backgroundMusicClips[i]; // _audio.Play(); // PlayerNotoriety.IncreasePlayerNotoriety(); //} //else //{ // PlayerNotoriety.DecreasePlayerNotoriety(); //} }
// Update is called once per frame void Update() { float n = PlayerNotoriety.GetPlayerNotoriety(); //Mathf.Lerp(PlayerNotoriety.GetPlayerNotoriety(), 0f, frequencyOfNotorietyIncrease); if (n != 0f && Time.timeScale != 0f) //timer > frequencyOfNotorietyIncrease && Time.timeScale != 0f) { timer -= Time.deltaTime; if (n < 0f && timer <= 0f) { PlayerNotoriety.IncreasePlayerNotoriety(); timer = frequencyOfNotorietyIncrease; //Debug.Log("Notoriety is going up." + n.ToString()); } else if (n > 0f && timer <= 0f) { PlayerNotoriety.DecreasePlayerNotoriety(); timer = frequencyOfNotorietyIncrease; //Debug.Log("Notoriety is going down." + n.ToString()); } else { //Debug.Log("Notoriety is 0"); } } //else //{ //} //Debug.Log("Notoriety:\t" + n.ToString()); }
public void NPC_ResponseToBad() { PlayerNotoriety.DecreasePlayerNotoriety(); npcText.text = DialogueTable.PickRandomResponse(); isTalking = false; UnFreezeScene(); }
/// <summary> /// Interaction with a balloon. /// </summary> /// <returns>The interaction.</returns> private IEnumerator Balloon_Interaction() { // Wait a random time to stagger clustered baloons yield return(new WaitForSeconds(Random.Range(0.01f, 0.25f))); // Play popping audio _audioSource.pitch += Random.Range(-0.05f, 0.05f); _audioSource.Play(); // Hide the balloon _meshRenderer.enabled = false; // Disable further interaction OnTriggerExit(); // Wait for audio clip to complete yield return(new WaitWhile(() => _audioSource.isPlaying)); // Set being interacted with to false _isBeingInteractedWith = false; // De-activate the game object gameObject.SetActive(false); //Modify notoriety field PlayerNotoriety.DecreasePlayerNotoriety(); // Flush the point of interest and retarget all audience NPCs _cellEntity.Flush_Point_Of_Interest(); }