コード例 #1
0
 public void freePatrolman(Patrolman patrolman)
 {
     free.Add(patrolman);
     if (!used.Remove(patrolman))
     {
         return;
     }
     patrolman.obj.SetActive(false);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }