コード例 #1
0
 void ClearTrackers()
 {
     res     = null;
     com     = null;
     ind     = null;
     off     = null;
     indc    = null;
     fol     = null;
     serv    = null;
     tracker = null;
 }
コード例 #2
0
    public void removeIndustrial(GameObject removeObject)
    // Remove an industrial building
    {
        IndustrialTracker temp = removeObject.GetComponent <IndustrialTracker>();

        EconomyManager.ecoTick -= temp.UpdateSecond;
        industrialCap          -= temp.capacity;
        temp.RemoveAllUsers();
        populationManager.DeallocateUsers(temp.users, "commercial");
        numIndustrial--;
        industrial.Remove(removeObject);
    }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     if (Serializer.IsDeserializing)
     {
         return;
     }
     if (Serializer.IsLoading)
     {
         return;
     }
     industrialTracker = GetComponent <IndustrialTracker>();
     referencesUpdated = false;
     stareat           = GameObject.Find("Camera (eye)").transform;
 }
コード例 #4
0
    void Link()
    // Saves industrial tracker link and informs tracker of bonus
    {
        stopCheck += UnlinkIfMoving;

        List <IndustrialTracker> surroundingIndustrials = U.ReturnIndustrialTrackers(U.FindNearestBuildings(transform.position, radius));

        if (surroundingIndustrials.Count >= 1)
        {
            linkedTracker = surroundingIndustrials[0];
            if (linkedTracker)
            {
                linkedTracker.LinkComponent(this);
            }
        }
    }
コード例 #5
0
 void SetTracker()
 {
     ClearTrackers();
     tracker = containedBuilding.GetComponent <ItemTracker>();
     if (containedType == 0)
     {
         res        = containedBuilding.GetComponent <ResidentialTracker>();
         res.usable = false;
     }
     else if (containedType == 1)
     {
         com        = containedBuilding.GetComponent <CommercialTracker>();
         com.usable = false;
     }
     else if (containedType == 2)
     {
         ind        = containedBuilding.GetComponent <IndustrialTracker>();
         ind.usable = false;
     }
     else if (containedType == 3)
     {
         off        = containedBuilding.GetComponent <CommercialTracker>();
         off.usable = false;
     }
     else if (containedType == 4)
     {
         indc        = containedBuilding.GetComponent <IndustrialComponent>();
         indc.usable = false;
     }
     else if (containedType == 5)
     {
         fol        = containedBuilding.GetComponent <FoliageTracker>();
         fol.active = false;
     }
     else if (containedType == 6)
     {
         serv        = containedBuilding.GetComponent <ServiceTrackerBase>();
         serv.active = true;
     }
 }