Esempio n. 1
0
    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");
        }
    }
Esempio n. 2
0
    public void OffloadHoneyToWarehouse()
    {
        HoneyManager honeyManager = FindObjectOfType <HoneyManager>();

        honeyManager.AddHoneyToScore(honeyOnBee);
        honeyOnBee = 0;
        activity   = "waiting";
    }
Esempio n. 3
0
 private void OnMouseOver()
 {
     if (Input.GetMouseButtonDown(0))
     {
         HoneyManager honeyManager = FindObjectOfType <HoneyManager>();
         honeyManager.AddHoneyToScore(100);
     }
 }
Esempio n. 4
0
    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");
        }
    }
Esempio n. 5
0
    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");
        }
    }