Beispiel #1
0
        private static void AddCommand(CommandWrapper CommandWrapper, ConsoleCommandAttribute attribute, string prefix)
        {
            Assert.IsNotNull(CommandWrapper.Member);
            Assert.IsNotNull(attribute);
            Assert.IsNotNull(prefix);

            if (!CommandWrapper.IsStatic() && !(CommandWrapper.Member.DeclaringType.IsSubclassOf(typeof(MonoBehaviour))))
            {
                return;
            }

            string methodName = GetCommandName(CommandWrapper.Member, attribute);

            Assert.IsFalse(String.IsNullOrEmpty(methodName));

            string commandString = prefix.Length > 0 ? prefix + '.' + methodName : methodName;

            Commands.Add(commandString, CommandWrapper);
        }
Beispiel #2
0
 CommandDef(string name, CommandWrapper command)
 {
     _Name    = name;
     _Command = command;
 }