private void Awake() { if (instance == null) { instance = this; } }
private void Awake() { fruitSpawnerScript = FindObjectOfType <FruitsSpawner>(); lastSnakePosition = transform.position; moveTimer = 0f; audioSource = GetComponent <AudioSource>(); GetPlayerPrefs(); isAlive = true; }
public void InvokeSpecialPower(CatcherController catcher) { //Maybe change color of the button when clicked catcher.StarClick(); FruitsSpawner fruitsSpawner = GameObject.FindWithTag("CupcakeSpawner").GetComponent <FruitsSpawner>(); if (fruitsSpawner != null) { fruitsSpawner.SetSpawnType(SpawnType.Circular); } }
// Start is called before the first frame update void Awake() { fruitsSpawner = GameObject.FindWithTag("CupcakeSpawner").GetComponent <FruitsSpawner>(); animator = GetComponentInChildren <Animator>(); switch (fruitsSpawner.GetSpawnType()) { case SpawnType.Regular: SetTarget(UnityEngine.Random.Range(0, catchersHolder.transform.childCount)); break; case SpawnType.Circular: SetTarget(fruitsSpawner.GetRunningCircularIndex()); break; } }