Hi,
I’m not very good in scripting, i’ve never made c# before using Unity.
So i try to do my best but sometimes, it’s not very compact and light.
So i’m here to ask your help about this code, that i would like to make shorter / more compact.
using UnityEngine;
using System.Collections;
public class Coins : MonoBehaviour
{
public float cash;
voidUpdate(){
if(TileManager.score==1)
{
if(TileManager.score==3)
{
if(TileManager.score==7)
{
if(TileManager.score==10)
{
something like cash = cash + 100
}
ETC ... ... ... ...
else
{
something like cash = cash + 150
}
}
else
{
something like cash = cash + 50
}
}
else
{
something like cash = cash + 30
}
}
else
{
something like cash = cash + 10
}
Maybe my code is wrong, i have not test it yet because i don’t want to have this huge code if another way, more compact, to make it exist.
Thank you in advance for your help, have a nice day