예제 #1
0
 virtual public void StopWork(bool removeFromListRequest)
 {
     if (destroyed)
     {
         return;
     }
     else
     {
         destroyed = true;
     }
     if (workersCount > 0)
     {
         colony.AddWorkers(workersCount);
         workersCount = 0;
     }
     if (sign != null)
     {
         Object.Destroy(sign.gameObject);
     }
     if (subscribedToUpdate)
     {
         GameMaster.realMaster.labourUpdateEvent -= LabourUpdate;
         subscribedToUpdate = false;
     }
     if (showOnGUI)
     {
         if (observer.observingPlace == this)
         {
             observer.SelfShutOff();
             UIController.GetCurrent().GetMainCanvasController().ChangeChosenObject(ChosenObjectType.Plane);
         }
         showOnGUI = false;
     }
     if (removeFromListRequest)
     {
         colony?.RemoveWorksite(this);
     }
 }