private void Start() { prefabInstance = Instantiate(trapUIPrefab, transform); prefabInstance.SetActive(false); playerTraps = GameObject.FindGameObjectWithTag("Player").GetComponent <GnomeTrapControl>(); }
private void Start() { _text = GetComponent <Text>(); switch (element) { case Ellys.CableTrapAmount: traps = GameObject.FindGameObjectWithTag("Player").GetComponent <GnomeTrapControl>(); break; case Ellys.BBQTrapAmount: traps = GameObject.FindGameObjectWithTag("Player").GetComponent <GnomeTrapControl>(); break; case Ellys.Fireworks: firework = GameObject.FindGameObjectWithTag("Player").GetComponent <FireworkMove>(); break; default: break; } }