Example #1
0
        public override void OnAction(AISController ctrl)
        {
            base.OnAction(ctrl);

            AISVarList l = (AISVarList)ctrl.GetVar(listKey);

            l.PassToSingle((AISVarSingle)ctrl.GetVar(best), GetBest(ctrl, l));
        }
Example #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);
        }
Example #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);
        }
Example #4
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);
        }
Example #5
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);
        }
Example #6
0
        public static float GetSingleFloat(AISController ctrl, AISVariable key)
        {
            if (!ctrl.ContainsKey(key))
            {
                return(0);
            }

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

            return(var.@float);
        }
Example #7
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);
        }
Example #8
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);
        }
Example #9
0
 public static T GetItemComponent <T>(AISController ctrl, AISVariable key) where T : InventorySystem.ItemComponent
 {
     return(((AISVarComponent)ctrl.GetVar(key)).GetItemComponent <T>());
 }
Example #10
0
 public static T GetComponent <T>(AISController ctrl, AISVariable key) where T : Component
 {
     return(((AISVarComponent)ctrl.GetVar(key)).GetComponent <T>());
 }