예제 #1
0
    public void UserDroneSpawned(UserDrone newDrone)
    {
        if (!userDrones.Contains(newDrone))
        {
            userDrones.Add(newDrone);
            droneList.DroneSpawned(newDrone);

            DroneBase db = newDrone.GetComponent <DroneBase>();
            if (db != null)
            {
                allDrones.Add(db);
            }

            if (offeringEscape)
            {
                offeringEscape = false;
                quickEscape.gameObject.SetActive(false);
            }
        }
    }
예제 #2
0
    public void UserDroneDestroyed(UserDrone destroyed)
    {
        if (userDrones.Contains(destroyed))
        {
            userDrones.Remove(destroyed);
            droneList.DroneDestroyed(destroyed);

            DroneBase db = destroyed.GetComponent <DroneBase>();
            if (db != null)
            {
                allDrones.Remove(db);
            }

            if (userDrones.Count <= 0)
            {
                if (quickEscape != null)
                {
                    quickEscape.gameObject.SetActive(true);
                }
                offeringEscape = true;
            }
        }
    }