Example #1
0
    // Start is called before the first frame update
    private void Start()
    {
        // Make the menu capable of invoking the end of a turn
        turnInvoker = gameObject.AddComponent <TurnInvoker>();

        EventManager.AddListener_Battle_InvSelect(MakeSelection);

        // for displaying "You are at full."
        messageTimer          = gameObject.AddComponent <EventTimer>();
        messageTimer.Duration = messageTimerDuration;
        messageTimer.AddListener_Finished(ResetMessage);

        // show gold
        goldText.text = BattleLoader.Party.Gold.ToString();
        // cannot use until a selection is made
        useButton.GetComponent <Button>().interactable = false;

        // retrieve inventory from HeroParty
        partyStash = BattleLoader.Party.Inventory;

        messageText.text = "";

        // Only used for invoking disable. No button.
        uiEnabler = gameObject.AddComponent <UIEnabler>();

        PopulateGrid();
    }
Example #2
0
 public static void AddInvoker_Battle_TurnOver(TurnInvoker turnScript)
 {
     invokers_Battle_TurnOver.Add(turnScript);
     if (listener_Battle_TurnOver != null)
     //foreach (UnityAction<int> listener in listeners_ChoiceSelection)
     {
         turnScript.AddListener_Battle_TurnOver(listener_Battle_TurnOver);
     }
 }