private void SpawnWorker() { HoneyManager honeyManager = FindObjectOfType <HoneyManager>(); if (honeyManager.HoneyGathered >= BeeCost) { GameObject bee = FindObjectOfType <Bee>().gameObject; if (bee != null) { honeyManager.AddHoneyToScore(-BeeCost); GameObject BeeCopy = (GameObject)Instantiate(Bee, bee.transform.position, Quaternion.identity); x += 1; BeeCopy.name = "Bee_worker" + x; Destroy(bee, 0f); } else { return; } } else { Debug.Log("Not enough honey"); } }
public void OffloadHoneyToWarehouse() { HoneyManager honeyManager = FindObjectOfType <HoneyManager>(); honeyManager.AddHoneyToScore(honeyOnBee); honeyOnBee = 0; activity = "waiting"; }
private void OnMouseOver() { if (Input.GetMouseButtonDown(0)) { HoneyManager honeyManager = FindObjectOfType <HoneyManager>(); honeyManager.AddHoneyToScore(100); } }
private void SpawnBee() { HoneyManager honeyManager = FindObjectOfType <HoneyManager>(); if (honeyManager.HoneyGathered >= BeeCost) { honeyManager.AddHoneyToScore(-BeeCost); GameObject BeeCopy = (GameObject)Instantiate(Bee, SpawnPlace, Quaternion.identity); x += 1; BeeCopy.name = "Bee_" + x; } else { Debug.Log("Not enough honey"); } }
public void BuildNewHex() { HoneyManager honeyManager = FindObjectOfType <HoneyManager>(); GenerateHexes hexgenerator = FindObjectOfType <GenerateHexes>(); if (honeyManager.HoneyGathered >= hexCost) { honeyManager.AddHoneyToScore(-hexCost); Currentlybuilt = true; hexgenerator.ToBuildHexes.Add(this.gameObject); this.GetComponentInChildren <SpriteRenderer>().color = Color.red; } else { Debug.Log("Not enough honey"); } }