示例#1
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);
        }
示例#2
0
        public static List <Vector3> GetListVector3(AISController ctrl, AISVariable key)
        {
            if (!ctrl.ContainsKey(key))
            {
                return(null);
            }

            AISVarList vars = (AISVarList)ctrl.GetVar(key);

            return(vars.vector3);
        }
示例#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 List <float> GetListFloat(AISController ctrl, AISVariable key)
        {
            if (!ctrl.ContainsKey(key))
            {
                return(null);
            }

            AISVarList vars = (AISVarList)ctrl.GetVar(key);

            return(vars.@float);
        }
示例#5
0
        public static float GetSingleFloat(AISController ctrl, AISVariable key)
        {
            if (!ctrl.ContainsKey(key))
            {
                return(0);
            }

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

            return(var.@float);
        }
示例#6
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);
        }
示例#7
0
        public static List <T> GetListObject <T>(AISController ctrl, AISVariable key) where T : Object
        {
            if (!ctrl.ContainsKey(key))
            {
                return(null);
            }

            AISVarList vars = (AISVarList)ctrl.GetVar(key);

            List <T> list = [email protected](x => x is T).Select(x => (T)x).ToList();

            if (list == null || list.Count == 0)
            {
                return(null);
            }

            return(list);
        }