public void freePatrolman(Patrolman patrolman) { free.Add(patrolman); if (!used.Remove(patrolman)) { return; } patrolman.obj.SetActive(false); }
public static CCMove GetSSAction(Patrolman p) { CCMove action = ScriptableObject.CreateInstance <CCMove>(); action.p = p; action.state = 2; action.direction = Direction.EAST; action.speed = 10; return(action); }
public Patrolman getPatrolman(int area) { Patrolman newPatrolman; if (free.Count > 0) { newPatrolman = free[0]; free.RemoveAt(0); newPatrolman.setArea(area); } else { newPatrolman = new Patrolman(area); } used.Add(newPatrolman); newPatrolman.obj.SetActive(true); return(newPatrolman); }