Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        player = this.transform.Find("/PlayerInfo").GetComponent <Character>();

        //battleMenu.setActive(false);
        playersTurn = false;
        battleInfo  = this.transform.Find("BattleInfo").gameObject;
        battleMenu  = this.transform.Find("BattleMenu").gameObject;

        turnText = battleInfo.transform.Find("Turn").gameObject;
        stats    = battleInfo.transform.Find("Stats").gameObject;

        player.transform.position = new Vector3(-8f, -1.5f, 0);
        enemyInfo = player.enemy;
        SetSprites();
    }
Esempio n. 2
0
 public void HarvestCrops(Character.PlantType plant)
 {
     if (plant == Character.PlantType.Carrot)
     {
         Carrots += 1;
     }
     else if (plant == Character.PlantType.Tomato)
     {
         Tomatoes += 1;
     }
     else if (plant == Character.PlantType.Potato)
     {
         Potatoes += 1;
     }
     else if (plant == Character.PlantType.Cabbage)
     {
         Cabbages += 1;
     }
 }
Esempio n. 3
0
 public void Shop(Character.PlantType plant, bool buyShop)
 {
     if (buyShop)
     {
         if (plant == Character.PlantType.Tomato)
         {
             if (Coins >= 1)
             {
                 TomatoSeeds += 1;
                 Coins       -= 1;
             }
         }
         else if (plant == Character.PlantType.Carrot)
         {
             if (Coins >= 2)
             {
                 CarrotSeeds += 1;
                 Coins       -= 2;
             }
         }
         else if (plant == Character.PlantType.Potato)
         {
             if (Coins >= 3)
             {
                 PotatoSeeds += 1;
                 Coins       -= 3;
             }
         }
         else if (plant == Character.PlantType.Cabbage)
         {
             if (Coins >= 4)
             {
                 CabbageSeeds += 1;
                 Coins        -= 4;
             }
         }
     }
     else //use for selling
     {
         if (plant == Character.PlantType.Tomato)
         {
             if (Tomatoes > 0)
             {
                 Tomatoes -= 1;
                 Coins    += 3;
             }
         }
         else if (plant == Character.PlantType.Carrot)
         {
             if (Carrots > 0)
             {
                 Carrots -= 1;
                 Coins   += 6;
             }
         }
         else if (plant == Character.PlantType.Potato)
         {
             if (Potatoes > 0)
             {
                 Potatoes -= 1;
                 Coins    += 9;
             }
         }
         else if (plant == Character.PlantType.Cabbage)
         {
             if (Cabbages > 0)
             {
                 Cabbages -= 1;
                 Coins    += 12;
             }
         }
     }
 }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     seeds = Player.seeds;
 }
Esempio n. 5
0
 // Start is called before the first frame update
 void Start()
 {
     PlantGrowing = false;
     seeds        = Player.seeds;
     scoreKeeper  = Player.GetComponent <ScoreKeeper>();
 }