public void adsorbOnSuccessRewardGranted(string filterName) { // Reward granted for success ad SelectPlayer.score = GameStart.rewardScore; SelectPlayer.money = GameStart.rewardMoney; UpdateDbase.updateDatabase(); UpdateDbase.updateScore(); UpdateDbase.updateMoney(); }
public void objectHit() { if (GameStart.clueIndex1 > 3) { Debug.Log("Clue 1 complete."); } else if (this.gameObject.name == GameStart.objectArray [GameStart.clues [GameStart.clueIndex1]].name) { objectPressedName = this.gameObject.name; objectPressedName2 = this.gameObject.name; StartCoroutine("delayUpdate", 1); updateVars(); //this.gameObject.SetActive(false); } if (GameStart.clueIndex2 > 3) { Debug.Log("Clue 2 complete."); } else if (this.gameObject.name == GameStart.objectArray [GameStart.clues [GameStart.clueIndex2] + 10].name) { objectPressedName = this.gameObject.name; objectPressedName2 = this.gameObject.name; StartCoroutine("delayUpdate", 2); updateVars(); //this.gameObject.SetActive(false); } if (GameStart.clueIndex3 > 3) { Debug.Log("Clue 2 complete."); } else if (this.gameObject.name == GameStart.objectArray [GameStart.clues [GameStart.clueIndex3] + 20].name) { objectPressedName = this.gameObject.name; objectPressedName2 = this.gameObject.name; StartCoroutine("delayUpdate", 3); updateVars(); //this.gameObject.SetActive(false); } if (GameStart.clueIndex4 > 2) { Debug.Log("Clue 2 complete."); } else if (this.gameObject.name == GameStart.objectArray [GameStart.clues [GameStart.clueIndex4] + 30].name) { objectPressedName = this.gameObject.name; objectPressedName2 = this.gameObject.name; StartCoroutine("delayUpdate", 4); updateVars(); //this.gameObject.SetActive(false); } breakInc(); UpdateDbase.updateScore(); UpdateDbase.updateObjectsNum(); }
public void runLC() { levelComplete.SetActive(true); levelCompleteBg.SetActive(true); game.SetActive(false); gameGui.SetActive(false); if (LevelManager.playMode == "story") { if (LevelManager.currentLevel == 60) { cashAnim.GetComponent <Text> ().text = "Cash Bonus: $12000"; UpdateDbase.addedCash = SelectPlayer.money + 12000; shopBtn.SetActive(false); nextBtn.SetActive(false); StartCoroutine("cashAnimDelay"); StartCoroutine("showShopBtn"); } else if (LevelManager.currentLevel == 120) { cashAnim.GetComponent <Text> ().text = "Cash Bonus: $13000"; UpdateDbase.addedCash = SelectPlayer.money + 13000; shopBtn.SetActive(false); nextBtn.SetActive(false); StartCoroutine("cashAnimDelay"); StartCoroutine("showShopBtn"); } else if (LevelManager.currentLevel == 180) { cashAnim.GetComponent <Text> ().text = "Cash Bonus: $14000"; UpdateDbase.addedCash = SelectPlayer.money + 14000; shopBtn.SetActive(false); nextBtn.SetActive(false); StartCoroutine("cashAnimDelay"); StartCoroutine("showShopBtn"); } else if (LevelManager.currentLevel == 240) { cashAnim.GetComponent <Text> ().text = "Cash Bonus: $15000"; UpdateDbase.addedCash = SelectPlayer.money + 15000; shopBtn.SetActive(false); nextBtn.SetActive(false); StartCoroutine("cashAnimDelay"); StartCoroutine("showShopBtn"); } else { cashAnim.SetActive(false); } PlayerPrefs.SetInt("CurrentLevel" + GameManager.num, LevelManager.currentLevel); Debug.Log("Current Level: " + PlayerPrefs.GetInt("CurrentLevel" + GameManager.num)); } else { cashAnim.SetActive(false); } if (LevelManager.currentLevel == 300) { nextBtn.SetActive(false); } UpdateDbase.updateDatabase(); UpdateDbase.updateScore(); UpdateDbase.updateMoney(); //resetVariables(); if (LevelManager.currentLevel == 1 && LevelManager.playMode == "story") { nextBtn.SetActive(false); } // Adsorb Ads if (PlayerPrefs.GetInt("CurrentLevel" + GameManager.num) % 3 != 0) { rewardScore = SelectPlayer.score + 100; rewardMoney = SelectPlayer.money + 50; if (!Version.noAds) { AdsorbAds.ShowSuccessAd(null, null); } } ShowAds.InterstitialAd(); }
public void setStage() { UpdateDbase.updateDatabase(); UpdateDbase.updateScore(); UpdateDbase.updateMoney(); resetVars(); levelComplete.SetActive(false); levelCompleteBg.SetActive(false); game.SetActive(true); objectArray = new List <GameObject>(); objectArray.AddRange(GameObject.FindGameObjectsWithTag("Hidden Objects")); decorArray = GameObject.FindGameObjectsWithTag("Decoratives"); clueObject = GameObject.FindGameObjectsWithTag("Object Clues"); wordArray = GameObject.FindGameObjectsWithTag("Word Clues"); for (int x = 0; x < objectArray.Count; x++) { Image objSprite = objectArray[x].GetComponent <Image>(); objSprite.sprite = (Sprite)Resources.Load("LevelSprites/" + LevelSpawn.newLevel + "/" + objectArray[x].name, typeof(Sprite)); } for (int x = 0; x < decorArray.Length; x++) { Image objSprite = decorArray[x].GetComponent <Image>(); objSprite.sprite = (Sprite)Resources.Load("LevelSprites/" + LevelSpawn.newLevel + "/" + decorArray[x].name, typeof(Sprite)); } if (rdmMode == 1 || rdmMode == 2) { for (int x = 0; x < 4; x++) { wordArray [x].SetActive(false); } } else if (rdmMode == 3) { for (int x = 0; x < 4; x++) { clueObject [x].SetActive(false); } } if (newMode == 1) { for (int x = 0; x < 4; x++) { clueObject[x].transform.rotation = new Quaternion(0, 0, 180, 0); wordArray [x].transform.rotation = new Quaternion(0, 0, 180, 0); } } else if (newMode == 2) { for (int x = 0; x < 4; x++) { clueObject[x].transform.rotation = new Quaternion(0, 180, 0, 0); wordArray [x].transform.rotation = new Quaternion(0, 180, 0, 0); } } else if (newMode == 3) { for (int x = 0; x < 4; x++) { fader.SetActive(true); } } else if (newMode == 4) { for (int x = 0; x < 4; x++) { clueObject[x].transform.rotation = new Quaternion(0, 0, 180, 0); wordArray [x].transform.rotation = new Quaternion(0, 0, 180, 0); fader.SetActive(true); } } else if (newMode == 5) { for (int x = 0; x < 4; x++) { clueObject[x].transform.rotation = new Quaternion(0, 180, 0, 0); wordArray [x].transform.rotation = new Quaternion(0, 180, 0, 0); fader.SetActive(true); } } else if (newMode == 6) { for (int x = 0; x < 4; x++) { clueMask.SetActive(true); } } else if (newMode == 7) { for (int x = 0; x < 4; x++) { clueObject[x].transform.rotation = new Quaternion(0, 0, 180, 0); wordArray [x].transform.rotation = new Quaternion(0, 0, 180, 0); clueMask.SetActive(true); } } else if (newMode == 8) { for (int x = 0; x < 4; x++) { clueObject[x].transform.rotation = new Quaternion(0, 180, 0, 0); wordArray [x].transform.rotation = new Quaternion(0, 180, 0, 0); clueMask.SetActive(true); } } else if (newMode == 9) { for (int x = 0; x < 4; x++) { clueMask.SetActive(true); fader.SetActive(true); } } else if (newMode == 10) { for (int x = 0; x < 4; x++) { clueObject[x].transform.rotation = new Quaternion(0, 0, 180, 0); wordArray [x].transform.rotation = new Quaternion(0, 0, 180, 0); clueMask.SetActive(true); fader.SetActive(true); } } else if (newMode == 11) { for (int x = 0; x < 4; x++) { clueObject[x].transform.rotation = new Quaternion(0, 180, 0, 0); wordArray [x].transform.rotation = new Quaternion(0, 180, 0, 0); clueMask.SetActive(true); fader.SetActive(true); } } }