Ejemplo n.º 1
0
 /// <summary>
 /// Input text to display at a specific fixed popUp (won't display until ExecuteFixed is called)
 /// NOTE: text is automatically appended to any existing text (on a new line)
 /// </summary>
 /// <param name="popPos"></param>
 /// <param name="textToDisplay"></param>
 public void SetData(PopUpPosition popPos, string textToDisplay)
 {
     if (GameManager.i.turnScript.CheckIsAutoRun() == false)
     {
         if (string.IsNullOrEmpty(textToDisplay) == false)
         {
             int index = (int)popPos;
             //if existing text use line break
             if (arrayOfTexts[index].text.Length > 0)
             {
                 arrayOfTexts[index].text = string.Format("{0}{1}{2}", arrayOfTexts[index].text, "\n", textToDisplay);
             }
             else
             {
                 arrayOfTexts[index].text = textToDisplay;
             }
             //set active index true (enables display)
             arrayOfActive[index] = true;
             if (isTestLog)
             {
                 Debug.LogFormat("[Tst] PopUpFixed.cs -> SetData: {0} -> \"{1}\"{2}", popPos, textToDisplay, "\n");
             }
         }
         else
         {
             Debug.LogWarning("Invalid textToDisplay (Null or Empty)");
         }
     }
 }
Ejemplo n.º 2
0
    /// <summary>
    /// Overloaded method that takes an actors slotID for PopUptext (won't display until ExecuteFixed is called)
    /// NOTE: text is appended to any existing text (on a new line)
    /// </summary>
    /// <param name="actorSlotID"></param>
    /// <param name="textToDisplay"></param>
    public void SetData(int actorSlotID, string textToDisplay)
    {
        PopUpPosition pop = PopUpPosition.Count;

        switch (actorSlotID)
        {
        case 0: pop = PopUpPosition.ActorSlot0; break;

        case 1: pop = PopUpPosition.ActorSlot1; break;

        case 2: pop = PopUpPosition.ActorSlot2; break;

        case 3: pop = PopUpPosition.ActorSlot3; break;
        }
        if (pop != PopUpPosition.Count)
        {
            SetData(pop, textToDisplay);
        }
    }