void Start() { Button btn = GetComponent <Button>(); btn.onClick.AddListener(TaskOnClick); gameManager = master.GetComponent <gameMoney>(); }
void Start() { //set the object renderer to allow for material changes rend = GetComponent <Renderer>(); //set the start colour as... the start colour startColor = rend.material.color; gameManager = master.GetComponent <gameMoney>(); }
//allows this object to be called elsewhere void Awake() { inithappiness = 50; maxhappiness = 100; happinessmodifier = 1.0f; happiness = inithappiness; if (instance == null) { return; } instance = this; }
// Use this for initialization void Start() { smallPlaying = false; mediumPlaying = false; largePlaying = false; noise = GetComponents <AudioSource>(); small = noise[0]; medium = noise[1]; large = noise[2]; small.loop = true; medium.loop = true; large.loop = true; gameManager = master.GetComponent <gameMoney>(); playMusic(); }