Skip to content

Instantly share code, notes, and snippets.

@alexson
Created January 13, 2022 09:51
Show Gist options
  • Save alexson/0dc52e4212c27d38e1f7d6c75b89d08a to your computer and use it in GitHub Desktop.
Save alexson/0dc52e4212c27d38e1f7d6c75b89d08a to your computer and use it in GitHub Desktop.
public static class GameVal
{
public static GameControl gc;
}
public class GameControl : MonoBehaviour
{
public int score;
public int scorePerExplosion = 300;
private void Awake()
{
GameVal.gc = this;
}
void Start()
{
Init();
}
public void Init()
{
score = 0;
}
public void AddScore()
{
score += scorePerExplosion;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment