I want from my script to change the color of the button that identify from the Function OnClick. It's possible ?
public float Money;
public GameObject[] upgrade_health_level;
public int[] Player1_heal;
void Start()
{
Money = 60;
Player1_heal = new int[6];
}
// Update is called once per frame
void Update()
{
} // END UPDATE
public void upgrade_HEAL() // button OnClick
{
if (Player1_heal[0] == 0 && Money >= 10)
{
Money -= 10;
Player1_heal[0]++;
upgrade_health_level[0].transform.localPosition = new Vector3(10, 0, 0);
}
else if (Player1_heal[0] == 1 && Money >= 10)
{
Money -= 10;
Player1_heal[0]++;
upgrade_health_level[0].transform.localPosition = new Vector3(20, 0, 0);
// Change the button color that use this function
}
}