// Use this for initialization void Awake() { aud = GetComponent <AudioSource>(); DontDestroyOnLoad(gameObject); anim = GetComponent <Animator>(); Instance = this; }
void Update() { if (playerObj == null) { playerObj = GameObject.FindGameObjectWithTag("player").GetComponent <Player>(); } if (hudObj == null) { hudObj = GameObject.FindGameObjectWithTag("UI").GetComponent <hud>(); } if (ldScrn == null) { ldScrn = GameObject.FindGameObjectWithTag("LdScrn").GetComponent <loadingScreen>(); } }