Ejemplo n.º 1
0
    public void LeftClick()
    {
        switch (GameController.CurrentlySelectedStichija)
        {
        case Stichija.Audra:
            pollution.ReducePollution();
            RightClick();
            break;

        case Stichija.Kometos:
            pollution.IncreasePollution();
            RightClick();
            break;

        case Stichija.Viesulas:
            pollution.IncreasePollution();
            RightClick();
            break;

        case Stichija.Zaibas:
            pollution.IncreasePollution();
            RightClick();
            break;

        default:
            break;
        }

        DeselectAllStichijos.Raise();
    }
Ejemplo n.º 2
0
    private void LeftClick(bool isTreeCut)
    {
        switch (GameController.CurrentlySelectedStichija)
        {
        case Stichija.Audra:
            if (isTreeCut)
            {
                pollution.ReducePollution();
                spotController.trees.GetComponent <Animator>().SetTrigger("Grow");
                spotController.ShrunkTrees = false;
            }
            break;

        case Stichija.Kometos:
            pollution.IncreasePollution();
            RightClick();
            break;

        case Stichija.Viesulas:
            pollution.IncreasePollution();
            RightClick();
            break;

        case Stichija.Zaibas:
            pollution.IncreasePollution();
            RightClick();
            break;

        default:
            break;
        }
    }
Ejemplo n.º 3
0
 public void DisableTrees()
 {
     if (CurrentlyEnabled == trees)
     {
         trees.GetComponent <Animator>().SetTrigger("Shrink");
         pollutionReference.IncreasePollution();
         ShrunkTrees = true;
     }
 }
Ejemplo n.º 4
0
    void cutDownTrees()
    {
        if (getEmptySpots().Count <= destroyTreesWhen)
        {
            timeBeforeNextTreeCut -= Time.deltaTime;
        }

        List <SpotController> treesEnabled = getPopulatedGoodSpots();

        if (timeBeforeNextTreeCut <= 0f && treesEnabled.Count > 0)
        {
            SpotController randomTreeSpot = treesEnabled[Random.Range(0, treesEnabled.Count)];
            randomTreeSpot.trees.GetComponent <Animator>().SetTrigger("Shrink");
            randomTreeSpot.ShrunkTrees = true;
            pollution.IncreasePollution();
            ResetTreeCutCounter();
        }
    }