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(); }
// Runs every game update void Update() { if (rdmMode == 1 || rdmMode == 2) { updateClue(); } else if (rdmMode == 3) { updateWords(); } if (objNum == 15) { StartCoroutine("lcDelay"); } // Updates time bonus added score UpdateDbase.timeBonus(); }
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); } } }
public void coinHit() { coinSound.Play(); GameStart.objNum++; if (ObjectPressed.coins1 != null) { if (this.gameObject.name == ObjectPressed.coins1.name) { if (GameStart.rdmMode == 1 || GameStart.rdmMode == 2) { GameStart.clueObject[0].SetActive(true); } else if (GameStart.rdmMode == 3) { GameStart.wordArray[0].SetActive(true); } SelectPlayer.money += ObjectPressed.currentCoin[0]; moneyBonus1 = (GameObject)Instantiate(Resources.Load("Levels/moneyBonus"), ObjectPressed.coins1.transform.position, ObjectPressed.coins1.transform.rotation); moneyBonus1.transform.SetParent(GameObject.Find("Game Objects").transform); moneyBonus1.transform.localScale = new Vector3(1, 1, 1); moneyBonus1.GetComponent <Text>().text = "+$" + ObjectPressed.currentCoin[0]; Destroy(moneyBonus1, 2f); Destroy(ObjectPressed.coins1); GameStart.clueIndex1++; } } if (ObjectPressed.coins2 != null) { if (this.gameObject.name == ObjectPressed.coins2.name) { if (GameStart.rdmMode == 1 || GameStart.rdmMode == 2) { GameStart.clueObject[1].SetActive(true); } else if (GameStart.rdmMode == 3) { GameStart.wordArray[1].SetActive(true); } SelectPlayer.money += ObjectPressed.currentCoin[1]; moneyBonus2 = (GameObject)Instantiate(Resources.Load("Levels/moneyBonus"), ObjectPressed.coins2.transform.position, ObjectPressed.coins2.transform.rotation); moneyBonus2.transform.SetParent(GameObject.Find("Game Objects").transform); moneyBonus2.transform.localScale = new Vector3(1, 1, 1); moneyBonus2.GetComponent <Text>().text = "+$" + ObjectPressed.currentCoin[1]; Destroy(moneyBonus2, 2f); Destroy(ObjectPressed.coins2); GameStart.clueIndex2++; } } if (ObjectPressed.coins3 != null) { if (this.gameObject.name == ObjectPressed.coins3.name) { if (GameStart.rdmMode == 1 || GameStart.rdmMode == 2) { GameStart.clueObject[2].SetActive(true); } else if (GameStart.rdmMode == 3) { GameStart.wordArray[2].SetActive(true); } SelectPlayer.money += ObjectPressed.currentCoin[2]; moneyBonus3 = (GameObject)Instantiate(Resources.Load("Levels/moneyBonus"), ObjectPressed.coins3.transform.position, ObjectPressed.coins3.transform.rotation); moneyBonus3.transform.SetParent(GameObject.Find("Game Objects").transform); moneyBonus3.transform.localScale = new Vector3(1, 1, 1); moneyBonus3.GetComponent <Text>().text = "+$" + ObjectPressed.currentCoin[2]; Destroy(moneyBonus3, 2f); Destroy(ObjectPressed.coins3); GameStart.clueIndex3++; } } if (ObjectPressed.coins4 != null) { if (this.gameObject.name == ObjectPressed.coins4.name) { if (GameStart.rdmMode == 1 || GameStart.rdmMode == 2) { GameStart.clueObject[3].SetActive(true); } else if (GameStart.rdmMode == 3) { GameStart.wordArray[3].SetActive(true); } SelectPlayer.money += ObjectPressed.currentCoin[3]; moneyBonus4 = (GameObject)Instantiate(Resources.Load("Levels/moneyBonus"), ObjectPressed.coins4.transform.position, ObjectPressed.coins4.transform.rotation); moneyBonus4.transform.SetParent(GameObject.Find("Game Objects").transform); moneyBonus4.transform.localScale = new Vector3(1, 1, 1); moneyBonus4.GetComponent <Text>().text = "+$" + ObjectPressed.currentCoin[3]; Destroy(moneyBonus4, 2f); Destroy(ObjectPressed.coins4); GameStart.clueIndex4++; } } UpdateDbase.updateMoney(); }