/// <summary>
 /// Inserts to the front of thoughts List
 /// </summary>
 public void AddPlayerThought(
     Model_Thought thought,
     Model_PlayerThoughts thoughts
     )
 {
     thoughts.uglyThoughts.Insert(0, thought);
 }
 public void RemovePlayerThought(
     Model_Thought thought,
     Model_PlayerThoughts thoughts
     )
 {
     thoughts.uglyThoughts.Remove(thought);
 }
Example #3
0
    public virtual void Setup(
        Model_Thought _thought,
        AudioClip _deathCry
        )
    {
        audioSource = GetComponent <AudioSource>();

        thought     = _thought;
        deathCrySFX = _deathCry;

        /// Setup character stats
        base.Setup();
    }
Example #4
0
    public void CloseThought(Model_Thought thoughtObj)
    {
        float waitTime = 0f;

        foreach (char letter in thoughtObj.thought.ToCharArray())
        {
            waitTime += timePerChar;
        }

        waitTime += waitTimeBuffer;

        coroutine = WaitToCloseThought(waitTime);

        StartCoroutine(coroutine);
    }
    /// <summary>
    /// Handles copying thoughts into slots
    /// </summary>
    public void UpdatePlayerThoughts(
        Model_Thought thought,
        Model_PlayerThoughts thoughts,
        Script_PlayerThoughtsInventoryButton[] thoughtSlots
        )
    {
        foreach (Script_PlayerThoughtsInventoryButton ts in thoughtSlots)
        {
            ts.text.text = string.Empty;
        }

        // works ONLY if thoughts is exactly equal to maxHP
        for (int i = 0; i < thoughts.uglyThoughts.Count; i++)
        {
            string newThoughtText = thoughts.uglyThoughts[i].thought;
            thoughtSlots[i].text.text = Script_Utils.FormatString(newThoughtText);
        }
    }
Example #6
0
    public void ShowThought(Model_Thought thought)
    {
        // stop any coroutine here
        if (isShowingThought)
        {
            StopCoroutine(coroutine);
            thoughtText.text = "";
        }

        isShowingThought = true;

        thoughtText.text = Script_Utils.FormatString(thought.thought);

        canvasGroup.gameObject.SetActive(true);
        canvasGroup.alpha          = 1f;
        canvasGroup.blocksRaycasts = true;

        audioSource.PlayOneShot(thoughtStartSoundFX, 1.0f);
    }
Example #7
0
 public void AddThought(Model_PlayerThoughts thoughts, Model_Thought thought)
 {
     // TODO: don't hardcode this
     thoughts.uglyThoughts.Add(thought);
 }