mirror of
https://github.com/ConjureETS/Human-Farm-Tycoon.git
synced 2026-03-24 18:31:07 +00:00
New Class: Stats (Main class storing our variables for our resources) Added some buttons and text fields to the scene to show off the functionality of our Stats class.
61 lines
1.3 KiB
C#
61 lines
1.3 KiB
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using UnityEngine.UI;
|
|
|
|
public class RessourceController{
|
|
Stats stats;
|
|
Text viewWood;
|
|
Text viewRock;
|
|
Text viewCorpse;
|
|
Text viewMeat;
|
|
|
|
public RessourceController(Stats stats, Text viewW, Text viewR, Text viewC, Text viewM)
|
|
{
|
|
this.stats = stats;
|
|
this.viewCorpse = viewC;
|
|
this.viewWood = viewW;
|
|
this.viewRock = viewR;
|
|
this.viewMeat = viewM;
|
|
}
|
|
|
|
public void setRock(int nbRock){
|
|
stats.AmountOfRock = nbRock;
|
|
}
|
|
public int getRock(){
|
|
return stats.AmountOfRock;
|
|
}
|
|
public void setWood(int nbWood)
|
|
{
|
|
stats.AmountOfWood = nbWood;
|
|
}
|
|
public int getWood()
|
|
{
|
|
return stats.AmountOfWood;
|
|
}
|
|
public void setCorpse(int nbCorpse)
|
|
{
|
|
stats.AmountOfCorpse = nbCorpse;
|
|
}
|
|
public int getCorpse()
|
|
{
|
|
return stats.AmountOfCorpse;
|
|
}
|
|
public void setMeat(int nbMeat)
|
|
{
|
|
stats.AmountOfMeat = nbMeat;
|
|
}
|
|
public int getMeat()
|
|
{
|
|
return stats.AmountOfMeat;
|
|
}
|
|
|
|
public void UpdateView()
|
|
{
|
|
viewRock.text = ""+ getRock() +"";
|
|
viewMeat.text = "" + getMeat() + "";
|
|
viewWood.text = "" + getWood() + "";
|
|
viewCorpse.text = "" + getCorpse() + "";
|
|
}
|
|
|
|
}
|