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); }
public static List <Vector3> GetListVector3(AISController ctrl, AISVariable key) { if (!ctrl.ContainsKey(key)) { return(null); } AISVarList vars = (AISVarList)ctrl.GetVar(key); return(vars.vector3); }
public static Vector3 GetSingleVector3(AISController ctrl, AISVariable key) { if (!ctrl.ContainsKey(key)) { return(Vector3.zero); } AISVarSingle var = (AISVarSingle)ctrl.GetVar(key); return(var.vector3); }
public static List <float> GetListFloat(AISController ctrl, AISVariable key) { if (!ctrl.ContainsKey(key)) { return(null); } AISVarList vars = (AISVarList)ctrl.GetVar(key); return(vars.@float); }
public static float GetSingleFloat(AISController ctrl, AISVariable key) { if (!ctrl.ContainsKey(key)) { return(0); } AISVarSingle var = (AISVarSingle)ctrl.GetVar(key); return(var.@float); }
public static int GetSingleInt <T>(AISController ctrl, AISVariable key) { if (!ctrl.ContainsKey(key)) { return(0); } AISVarSingle var = (AISVarSingle)ctrl.GetVar(key); return(var.@int); }
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); }