Example #1
0
        // Update is called once per frame
        public void OnSubmit()
        {
            string Name = textBox.text.ToUpper();

            switch (Name)
            {
            case "MATRIX":
                MatrixPlayer.SetActive(true);
                break;

            case "BATMAN":
                BatmanPlayer.SetActive(true);
                break;

            case "SUPERMAN":
                SupermanPlayer.SetActive(true);
                break;

            default:
                Player.SetActive(true);
                break;
            }
            Panel.SetActive(false);

            //pass name to dialogue manager in game manager
            RandomDialogueTree tr = new RandomDialogueTree(Name);
            GameRules          g  = FindObjectOfType <GameRules>();

            g.t          = tr;
            g.playerName = Name;
            //and activate startDialogue
            g.DialogueMenu(tr.getStarterDialogue(Name));
        }
Example #2
0
        private void onStart()
        {
            Name = PlayerName.text.ToUpper();
            if (Name == "")
            {
                Name = "my parents didn't name me";
                System.Array.Find(players, (p) => p.name == "PLAYER").gameObject.SetActive(true);
            }
            else if (isSpecialCharacter(Name))
            {
                System.Array.Find(players, (p) => p.name == Name).gameObject.SetActive(true);
            }
            else
            {
                System.Array.Find(players, (p) => p.name == "PLAYER").gameObject.SetActive(true);
            }

            RandomDialogueTree tr = new RandomDialogueTree(Name);
            GameRules          g  = FindObjectOfType <GameRules>();

            g.t          = tr;
            g.playerName = Name;

            //and activate startDialogue
            Panel.SetActive(false);
            PanelInput.gameObject.SetActive(false);
            PanelTitle.gameObject.SetActive(false);
            PanelButton.gameObject.SetActive(false);
            PanelMessage.gameObject.SetActive(false);
            g.DialogueMenu(tr.getStarterDialogue(Name));
        }