ExampleMod.ExampleMod.ChatInput C# (CSharp) Method

ChatInput() public method

public ChatInput ( string text ) : void
text string
return void
        public override void ChatInput(string text)
        {
            if (text[0] != '/')
            {
                return;
            }
            text = text.Substring(1);
            int index = text.IndexOf(' ');
            string command;
            string[] args;
            if (index < 0)
            {
                command = text;
                args = new string[0];
            }
            else
            {
                command = text.Substring(0, index);
                args = text.Substring(index + 1).Split(' ');
            }
            if (command == "npc")
            {
                NPCCommand(args);
            }
            else if (command == "npcType")
            {
                NPCTypeCommand(args);
            }
            else if (command == "addTime")
            {
                AddTimeCommand(args);
            }
            else if (command == "item")
            {
                ItemCommand(args);
            }
            else if (command == "score")
            {
                ScoreCommand(args);
            }
            else if (command == "sound")
            {
                SoundCommand(args);
            }
            else if (command == "coin")
            {
                ExampleUI.visible = true;
            }
        }