Пример #1
0
    //  Buying shii...uff

    public void BuyingUpgrade(TechTreeButton _tech)
    {
        if (_tech.cost <= currentNutrients)
        {
            currentNutrients -= _tech.cost;
        }
    }
Пример #2
0
    public void BuyingSunUpgrade(TechTreeButton _tech)
    {
        if (_tech.cost <= currentNutrients)
        {
            currentNutrients -= _tech.cost;
            _tech.cost       += 20;
            maxSunlight      += 100;

            sunlightBar.maxValue += 100;

            if (sunUpgrades >= 5)
            {
                _tech.gameObject.SetActive(false);
            }
            sunUpgrades += 1;
        }
    }
Пример #3
0
    public void BuyingNutUpgrade(TechTreeButton _tech)
    {
        if (_tech.cost <= currentNutrients)
        {
            currentNutrients -= _tech.cost;
            _tech.cost       += 20;
            maxNutrients     += 100;

            nutrientsBar.maxValue += 100;

            if (nutUpgrades >= 5)
            {
                _tech.gameObject.SetActive(false);
            }
            nutUpgrades += 1;
        }
    }
Пример #4
0
 public void BuyingTechUpgrade(TechTreeButton _tech)
 {
     if (_tech.cost <= currentNutrients)
     {
         currentNutrients -= _tech.cost;
         FindObjectOfType <Roots>().tech += 1;
         _tech.cost += 20;
         if (spriteIterator < drills.Length)
         {
             _tech.gameObject.GetComponent <Image>().sprite = drills[spriteIterator++];
         }
         else
         {
             _tech.gameObject.SetActive(false);
         }
     }
 }
Пример #5
0
 public void BuyingLunarLeaf(TechTreeButton _tech)
 {
     if (_tech.cost <= currentNutrients)
     {
         currentNutrients -= _tech.cost;
         leavesGO[LunarLeafCount].GetComponent <LookAtSun>().m_lunar = true;
         _tech.cost += 20;
         if (LunarLeafCount < 4)
         {
             LunarLeafCount += 1;
         }
         else
         {
             _tech.gameObject.SetActive(false);
         }
     }
 }
Пример #6
0
    public void BuyingRotationUpgrade(TechTreeButton _tech)
    {
        if (_tech.cost <= currentNutrients)
        {
            currentNutrients -= _tech.cost;
            _tech.cost       += 20;
            for (int i = 0; i < 5; i++)
            {
                leavesGO[i].GetComponent <LookAtSun>().m_speed += 1.0f;
            }

            if (leafSpeed >= 5)
            {
                _tech.gameObject.SetActive(false);
            }
            leafSpeed += 1;
        }
    }
Пример #7
0
 public void BuyingLeaf(TechTreeButton _tech)
 {
     if (_tech.cost <= currentNutrients)
     {
         currentNutrients -= _tech.cost;
         if (leafCount < 4)
         {
             leavesGO[leafCount].SetActive(true);
             //Debug.Log("BSBHSBHSVHVS");
             _tech.cost += 20;
             leafCount++;
             //_tech.NoOfRebuys -= 1;
         }
         else
         {
             _tech.gameObject.SetActive(false);
         }
     }
     //Max leaves is 5
 }