void ClearTrackers() { res = null; com = null; ind = null; off = null; indc = null; fol = null; serv = null; tracker = null; }
public void removeCommercial(GameObject removeObject) // Removes commercial building { CommercialTracker temp = removeObject.GetComponent <CommercialTracker>(); EconomyManager.ecoTick -= temp.UpdateSecond; commercialCap -= temp.capacity; temp.RemoveAllUsers(); populationManager.DeallocateUsers(temp.users, "commercial"); numCommercial--; commercial.Remove(removeObject); }
// Use this for initialization void Start() { if (Serializer.IsDeserializing) { return; } if (Serializer.IsLoading) { return; } commercialTracker = GetComponent <CommercialTracker>(); referencesUpdated = false; stareat = GameObject.Find("Camera (eye)").transform; }
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; } }