void Awake() { if (instance == null) { instance = this; } if (instance != this) { Destroy(this); } }
void Awake() { backgroundMusic = SoundManager.singleton.instance.Play2DSong("FloppyDrift", 1.0f, true); allCameraLayers = Camera.main.cullingMask; currentOffice = null; governmentItems = GameObject.FindGameObjectsWithTag("GovernmentStuff"); foreach (GameObject go in governmentItems) { go.SetActive(false); } }
// Use this for initialization void Start() { officeGenerator = GameObject.FindObjectOfType <OfficeGenerator>(); canvas = GameObject.Find("PurchaseFacilityCanvas").GetComponent <Canvas>(); facilityList = FacilityList.instance; toggleGroup = GetComponent <ToggleGroup>(); playerStats = PlayerStats.instance; confirmButton = canvas.transform.Find("PurchaseButton").GetComponent <Button>(); foreach (FacilityInfo facility in facilityList.facilityList) { if (facility.facilityType != FacilityInfo.FacilityType.Empty && facility.facilityType != FacilityInfo.FacilityType.Copy) { GameObject newButton = GameObject.Instantiate(buttonPrefab, this.transform); newButton.GetComponent <Toggle>().group = toggleGroup; newButton.transform.Find("Name").GetComponent <Text>().text = facility.facilityName; newButton.transform.Find("CostToBuy").GetComponent <Text>().text = "Purchase: $" + facility.costToBuy.ToString("0.00"); newButton.transform.Find("CostPerMonth").GetComponent <Text>().text = "Monthly Cost: $" + facility.baseMonthlyExpenses.ToString("0.00"); } } }
public OfficeManager(int initialSize, OfficeGenerator officeGenerator, OfficeStats officeStats) { this.officeGenerator = officeGenerator; this.officeGenerator.InitOffice(initialSize); this.officeStats = officeStats; }
void Start() { officeGen = GameObject.Find("Elevator").GetComponent<OfficeGenerator>(); numberLeft = officeGen.numberOfOffices; }