コード例 #1
0
 /// <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();
     //}
 }
コード例 #2
0
    // 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());
    }
コード例 #3
0
 public void NPC_ResponseToGood()
 {
     PlayerNotoriety.IncreasePlayerNotoriety();
     npcText.text = DialogueTable.PickRandomResponse();
     isTalking    = false;
     UnFreezeScene();
 }
コード例 #4
0
    /// <summary>
    /// Interaction with the food.
    /// </summary>
    /// <returns>The interaction.</returns>
    private IEnumerator Food_Interaction()
    {
        //	Perform the interaction

        //	**************************
        //	Animate!
        //	**************************

        //Modify notoriety field
        PlayerNotoriety.IncreasePlayerNotoriety();
        yield return(new WaitForSeconds(2));

        _isBeingInteractedWith = false;
    }