public void UpLeaderBoad() { Social.localUser.Authenticate((bool success) => { if (success) { Debug.Log("You've successfully logged in"); } else { Debug.Log("Login failed for some reason"); } }); if (Social.localUser.authenticated) { Social.ReportScore(PlayerPrefsControll.GetBest(), leaderboard, (bool success) => { if (success) { } else { //Debug.Log("Login failed for some reason"); } }); } }
// Use this for initialization void Awake() { levelcontroll = GetComponent <LevelControll>(); if (GameData.TestGame) { // print("test"); return; } else { // print("no test"); if (PlayerPrefsControll.LevelSuccess(levelcontroll.Level - 1)) { play.sprite = playOn; GetComponent <Button>().enabled = true; } else { play.sprite = playOff; GetComponent <Button>().enabled = false; } } txtTarget.gameObject.SetActive(false); keo0.gameObject.SetActive(false); keo1.gameObject.SetActive(false); keo2.gameObject.SetActive(false); }
IEnumerator setScrollbarValue() { yield return(new WaitForSeconds(0.1f)); scrollbar.value = 1 - (PlayerPrefsControll.GetBest()) / 50f; //print(scrollbar.value); Canvas.ForceUpdateCanvases(); }
void Completed() { SoundController.Intance.Play(SoundController.CLIP.WIN); PlayerPrefsControll.SaveHigh(GameData.Level, GameData.Score); PlayerPrefsControll.SetBest(GameData.Level); ThongBao.GetComponent <Text>().text = "Level " + GameData.Level + " completed"; ThongBao.GetComponent <Text>().color = Color.white; ReplayWenWin.SetActive(true); Next.SetActive(true); PlayerPrefsControll.SaveLevel(GameData.Level); }
// Use this for initialization void Awake() { GameData.TestGame = TestModel; PlayerPrefsControll.TheFirst(); if (GameData.FirstStart) { GameData.FirstStart = false; StartCoroutine(Load()); } else if (GameData.NextLevel) { GameData.NextLevel = false; Menu.SetActive(false); loading.SetActive(false); worldMap.SetActive(true); StartCoroutine(setScrollbarValue()); } else { GoMenu(); } }
void Start() { txtLevel.text = levelcontroll.Level.ToString(); txtLevel.gameObject.GetComponent <RectTransform>().localPosition = new Vector3(-9, 15, 0); if (levelcontroll.MissionType == GameData.MISSIONTYPE.COLLECTION) { if (levelcontroll.Collection.Length == 1) { keo0.gameObject.SetActive(true); keo0.sprite = GetSprite(levelcontroll.Collection[0]); keo0.GetComponentInChildren <Text>().text = levelcontroll.Collection[0].Count.ToString(); } else if (levelcontroll.Collection.Length == 2) { keo1.gameObject.SetActive(true); keo1.GetComponent <Image>().sprite = GetSprite(levelcontroll.Collection[0]); keo1.GetComponentInChildren <Text>().text = levelcontroll.Collection[0].Count.ToString(); keo2.gameObject.SetActive(true); keo2.GetComponent <Image>().sprite = GetSprite(levelcontroll.Collection[1]);; keo2.GetComponentInChildren <Text>().text = levelcontroll.Collection[1].Count.ToString(); } } else { txtTarget.gameObject.SetActive(true); txtTarget.text = "Target:\n" + levelcontroll.TargetScore.ToString(); } if (PlayerPrefsControll.GetHigh(levelcontroll.Level) != 0) { foreach (Text txt in GetComponentsInChildren <Text>()) { if (txt.gameObject.name == "High") { txt.text = PlayerPrefsControll.GetHigh(levelcontroll.Level).ToString(); } } } }
void OnClick() { SoundController.Intance.Play(SoundController.CLIP.CLICK); if (GameData.Gold >= price) { myBut.enabled = false; GameData.Gold -= price; PlayerPrefsControll.SaveGold(GameData.Gold); buy.sprite = buyOff; if (isX2) { GameData.X2 = true; } else { GameData.TimePlus = time; } } else { info.text = "You don't enough coin"; StartCoroutine(clearInfo()); } }