private static String GetValue(ConCommandArgs args)
        {
            if (args.ValueCount != 1)
            {
                throw new Exception("Expected 1 argument: a member path");
            }

            var match = _sLocationParser.Parse(args.Values[0]);

            if (!match.Success)
            {
                throw new Exception(match.Error.ToString());
            }

            var member = FindMember(args.Domain, match[0]);

            return((member.GetValue() ?? "null").ToString());
        }
예제 #2
0
 public static void LogError(ConCommandArgs args)
 {
     Debug.LogError(args);
 }
예제 #3
0
 public static void LogWarning(ConCommandArgs args)
 {
     Debug.LogWarning(args);
 }
예제 #4
0
 public static Object Sum(ConCommandArgs args)
 {
     return(Enumerable.Range(0, args.ValueCount)
            .Sum(x => args.CanGet <double>(x) ? args.Get <double>(x) : 0d));
 }
예제 #5
0
 public static Object ArgCount(ConCommandArgs args)
 {
     return(args.Values.Length);
 }
예제 #6
0
 public static Object Echo(ConCommandArgs args)
 {
     return(String.Format("\"{0}\"", String.Join("\" \"", args.Values)));
 }