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]; } }
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 Vector3 GetSingleVector3(AISController ctrl, AISVariable key) { if (!ctrl.ContainsKey(key)) { return(Vector3.zero); } AISVarSingle var = (AISVarSingle)ctrl.GetVar(key); return(var.vector3); }
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 int Score(AISController controller, AISVarSingle var) { return(Score(controller, var.@object as Character)); }