예제 #1
0
        public void PassToSingle(AISVarSingle var, int idx)
        {
            if (@int != null && @int.Count != 0 && idx >= 0 && idx < @int.Count)
            {
                var.@int = @int[idx];
            }

            if (@float != null && @float.Count != 0 && idx >= 0 && idx < @float.Count)
            {
                var.@float = @float[idx];
            }

            if (vector3 != null && vector3.Count != 0 && idx >= 0 && idx < vector3.Count)
            {
                var.vector3 = vector3[idx];
            }

            if (@object != null && @object.Count != 0 && idx >= 0 && idx < @object.Count)
            {
                var.@object = @object[idx];
            }

            if (variable != null && variable.Count != 0 && idx >= 0 && idx < variable.Count)
            {
                var.variable = variable[idx];
            }
        }
예제 #2
0
        public static T GetSingleObject <T>(AISController ctrl, AISVariable key) where T : Object
        {
            if (!ctrl.ContainsKey(key))
            {
                return(null);
            }

            AISVarSingle var = (AISVarSingle)ctrl.GetVar(key);

            return(var.@object as T);
        }
예제 #3
0
        public static Vector3 GetSingleVector3(AISController ctrl, AISVariable key)
        {
            if (!ctrl.ContainsKey(key))
            {
                return(Vector3.zero);
            }

            AISVarSingle var = (AISVarSingle)ctrl.GetVar(key);

            return(var.vector3);
        }
예제 #4
0
        public static float GetSingleFloat(AISController ctrl, AISVariable key)
        {
            if (!ctrl.ContainsKey(key))
            {
                return(0);
            }

            AISVarSingle var = (AISVarSingle)ctrl.GetVar(key);

            return(var.@float);
        }
예제 #5
0
        public static int GetSingleInt <T>(AISController ctrl, AISVariable key)
        {
            if (!ctrl.ContainsKey(key))
            {
                return(0);
            }

            AISVarSingle var = (AISVarSingle)ctrl.GetVar(key);

            return(var.@int);
        }
예제 #6
0
 public int Score(AISController controller, AISVarSingle var)
 {
     return(Score(controller, var.@object as Character));
 }