private void OnLevelWasLoaded() { if (GameObject.Find("Player") != null) { player = GameObject.Find("Player").GetComponent <Caapora>(); } }
public void Awake() { if (_instance == null) { DontDestroyOnLoad(this); _instance = this; } else { if (this != _instance) { Destroy(gameObject); } } canFillBucket = false; keepObjectOnLevelLoad = true; // Altura = GameObject.Find("Altura").GetComponent<Text>(); CaaporaLifeBar = GameObject.Find("CaaporaStatus/life").GetComponent <Image>(); StatusHP = GameObject.Find("CaaporaStatus/Status/hp").GetComponent <Text>(); }
void Start() { PopulatePool(); player = GameObject.Find("Player").GetComponent <Caapora>(); if (_instance == null) { _instance = this; DontDestroyOnLoad(_instance); } else { if (this != _instance) { Destroy(this.gameObject); } } }