private void Awake() { currPubData = GeneralManager.GetPubSelected(); #if UNITY_EDITOR if (currPubData == null) { currPubData = GeneralManager.SelectPub(testPubName); } #endif LoadSceneTrackers(); }
void SetPubSelection(string pubName = "") { PubDataContainer.PubData pubData = GeneralManager.GetPubSelected(); // on Enter scene first time if (pubName.CompareTo("") == 0 && pubData == null) { } // on Set for first time or next times else if ( (pubName.CompareTo("") != 0 && pubData == null) || (pubName.CompareTo("") != 0 && pubData != null) ) { pubData = GeneralManager.SelectPub(pubName); if (pubData != null) { selectedPubText.text = pubData.pubName; selectedPubImage.sprite = pubData.pubLogo; } else { Debug.Log("Error pub not found " + pubName); } } // on Set from saved data else if (pubName.CompareTo("") == 0 && pubData != null) { Debug.Log("Load from saved data"); if (pubData != null) { selectedPubText.text = pubData.pubName; selectedPubImage.sprite = pubData.pubLogo; } else { Debug.Log("Error pub not found"); } } }