コード例 #1
0
 /// <summary>
 /// Called when a Building instance is successfully removed from being tracked and regulated by the NPCBuildingRegulator instance.
 /// </summary>
 /// <param name="building">Building instance that was removed.</param>
 protected override void OnSuccessfulRemove(Building building)
 {
     if (!HasReachedMaxAmount())         //and maximum allowed amount hasn't been reached yet
     {
         buildingCreator_NPC.Activate(); //activate building creator to create more instances of this unit type.
     }
 }
コード例 #2
0
        //regulating the building:


        //removes a building:
        public override void RemoveItem(Building building)
        {
            base.RemoveItem(building);
            //if the target amount is now not reached anymore:
            if (!HasReachedMinAmount())
            {
                buildingCreator_NPC.Activate(); //activate the building creator.
            }
        }