Esempio n. 1
0
        /// <summary>
        /// Display a given choice node
        /// </summary>
        private void ShowChoice(ConversationChoice choice, int index)
        {
            GameObject gameObj = buttonGameObjs[index];

            gameObj.SetActive(true);
            Button btn       = gameObj.GetComponent <Button>();
            Text   textField = btn.GetComponentInChildren <Text>();

            textField.text = choice.text;
        }
Esempio n. 2
0
        /// <summary>
        /// Select a choice at the given index
        /// </summary>
        /// <param name="choiceIndex"></param>
        public void SelectChoice(int choiceIndex)
        {
            ConversationChoice choice = currNode.choices[choiceIndex];

            // Save your choice
            SaveDecision(currNode, choiceIndex);

            currNode = currConv.nodeMap[choice.nextNodeTitle];

            EventController.GetInstance().FireEvent(EventTypeEnum.ShowNewConversationNode, currNode);

            // Apply the parameter modifiers upon viewing the choice
            ApplyParamModifiers(currNode);
        }