예제 #1
0
        private void Awake()
        {
            currPubData = GeneralManager.GetPubSelected();

#if UNITY_EDITOR
            if (currPubData == null)
            {
                currPubData = GeneralManager.SelectPub(testPubName);
            }
#endif
            LoadSceneTrackers();
        }
예제 #2
0
        public void GoConcursos()
        {
            PubDataContainer.PubData pubData = GeneralManager.GetPubSelected();

            if (pubData != null && pubData.hasDefinedPrizeScene)
            {
                SceneManager.LoadScene(pubData.definedPrizeScene);
            }
            else if (pubData != null && !pubData.hasDefinedARScene)
            {
                SceneManager.LoadScene(GeneralManager.ScenePrizeIndex);
            }
        }
예제 #3
0
 public void CameraMode()
 {
     PubDataContainer.PubData pubData = GeneralManager.GetPubSelected();
     if (pubData != null && pubData.hasDefinedARScene)
     {
         Debug.Log("scene index pubdata: " + pubData.definedARScene);
         SceneManager.LoadScene(pubData.definedARScene);
     }
     else if (pubData != null && !pubData.hasDefinedARScene)
     {
         Debug.Log("scene index general: " + GeneralManager.SceneARIndex);
         SceneManager.LoadScene(GeneralManager.SceneARIndex);
     }
 }
예제 #4
0
        public void OpenCLYCme()
        {
            PubDataContainer.PubData pubData = GeneralManager.GetPubSelected();


            if (pubData != null && pubData.definedConstestUrl && pubData.pubConstestButtonUrl.CompareTo("") != 0)
            {
                Debug.Log(pubData.pubConstestButtonUrl);
                Application.OpenURL(pubData.pubConstestButtonUrl);
            }
            else if (pubData != null && (!pubData.definedConstestUrl || pubData.pubConstestButtonUrl.CompareTo("") == 0))
            {
                Debug.Log(GeneralManager.Instance.pubData.ContestButtonURL);
                Application.OpenURL(GeneralManager.Instance.pubData.ContestButtonURL);
            }
        }
        private void Awake()
        {
            pubSelected = null;

            if (Instance == null)
            {
                Instance = this;
                DontDestroyOnLoad(gameObject);

                string pubSaved = PlayerPrefs.GetString(savedPubString);
            }
            else
            {
                DestroyImmediate(gameObject);
            }
        }
예제 #6
0
        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");
                }
            }
        }
예제 #7
0
        void BuildPubWindow()
        {
            PubDataContainer.PubData[] pubsData = GeneralManager.GetPubList();

            List <string> pubsNames  = new List <string>();
            List <Sprite> pubSprites = new List <Sprite>();
            int           index      = 0;

            foreach (PubDataContainer.PubData currPub in pubsData)
            {
                //Debug.Log(currPub.pubName);
                if (currPub.hidePubInList)
                {
                    continue;
                }
                pubsNames.Add(currPub.pubName);
                pubSprites.Add(currPub.pubLogo);
                //Debug.Log(currPub.pubName);
                index++;
            }

            locationMenuRef.SetLocations(pubsNames.ToArray(), pubSprites.ToArray(), this);
        }