public void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else if (instance != null) { Destroy(gameObject); } }
public void Start() { ClosestActionUIText = GameObject.Find("ActionText"); PlayerObject = GameObject.Find("Catthew_SweetCat_s10"); if (instance == null) { // DontDestroyOnLoad(gameObject); instance = this; } else if (instance != null) { Destroy(gameObject); } }