private IEnumerator WaitAndUpdate(float waitTime) { while (true) { yield return(new WaitForSeconds(waitTime)); //declarations character = GameObject.FindGameObjectWithTag("character"); maincam = GameObject.Find("Main Camera"); rdmobj = GameObject.Find("RdmGen").GetComponent <RdmObjGen>(); anim = character.GetComponent <Animation>(); if (ShieldbarSlider.value == ShieldbarSlider.maxValue) { //change button color sprShield = Resources.Load <Sprite>("Sprites/UI/btnShield"); btnShield.GetComponent <Image>().sprite = sprShield; } else { //change button color sprShield = Resources.Load <Sprite>("Sprites/UI/btnShieldGrayscale"); btnShield.GetComponent <Image>().sprite = sprShield; } if (ShieldbarSlider.value <= 0f && shieldSkillLvl >= 1) { if (!isRunning && !shieldIsOn) { regenShield(); } } } }
private IEnumerator WaitAndUpdate(float waitTime) { while (true) { yield return(new WaitForSeconds(waitTime)); //declarations character = GameObject.FindGameObjectWithTag("character"); rdmobj = GameObject.Find("RdmGen").GetComponent <RdmObjGen>(); anim = character.GetComponent <Animation>(); if (boostbarSlider.value == boostbarSlider.maxValue) { /* if (!invokeCollectiblesOnce) * { * rdmobj.invokeCollectibles = true; * invokeCollectiblesOnce = true; * }*/ //change button color sprBoost = Resources.Load <Sprite>("Sprites/UI/btnBoost"); btnBoost.GetComponent <Image>().sprite = sprBoost; } else { //change button color sprBoost = Resources.Load <Sprite>("Sprites/UI/btnBoostGrayscale"); btnBoost.GetComponent <Image>().sprite = sprBoost; } } }
void Start() { rdmobj = GameObject.Find("RdmGen").GetComponent <RdmObjGen>(); btnShield = gameObject.GetComponent <Button>(); scoreCounter = GameObject.Find("subScoreCounter").GetComponent <scoreCounter>(); achPowerTripScript = GameObject.Find("btnBoost").GetComponent <achPowerTripper>(); }
void Start() { rdmobj = GameObject.Find("RdmGen").GetComponent <RdmObjGen>(); boostLane = GameObject.Find("BoostLane"); healthbarSlider = GameObject.Find("healthSlider").GetComponent <Slider>(); boostbarSlider = GameObject.Find("boostSlider").GetComponent <Slider>(); ui = GameObject.Find("UI"); maincam = GameObject.Find("Main Camera"); cam = Camera.main; btnPause = GameObject.Find("Pause"); goPanel = GameObject.Find("goPanel"); gameover = goPanel.GetComponent <Animator>(); player = GameObject.FindGameObjectWithTag("Player"); scoring = GameObject.Find("subScoreCounter").GetComponent <scoreCounter>(); pDescend = player.gameObject.GetComponent <camdescend>(); anim = GameObject.FindGameObjectWithTag("character").GetComponent <Animation>(); btnShield = GameObject.Find("btnShield").GetComponent <Button>(); btnAttack = GameObject.Find("btnAttack").GetComponent <Button>(); btnBoost = GameObject.Find("btnBoost").GetComponent <Button>(); PlayerPrefs.DeleteKey("tempGoldCoins"); colCoins = GameObject.Find("txtCc").GetComponent <Text>(); character = GameObject.FindGameObjectWithTag("character"); lvlUpScript = GameObject.Find("subScoreCounter").GetComponent <levelUp>(); swipeScript = maincam.gameObject.GetComponent <SwipeMovement>(); txtExpReq = GameObject.Find("txtExpReq").GetComponent <Text>(); expSlider = GameObject.Find("expSlider").GetComponent <Slider>(); txtExpCur = GameObject.Find("txtExpCur").GetComponent <Text>(); rewardedAdsScript = GameObject.Find("simpleAd").GetComponent <rewardedAds>(); uigoldScript = GameObject.Find("txtuigold").GetComponent <uigoldUpdater>(); pauseScript = GameObject.Find("onPause").GetComponent <pauseScale>(); uigoldScript.updateGoldCoin(); }
void Start() { rdmobj = GameObject.Find("RdmGen").GetComponent <RdmObjGen>(); spawnPointProjectile = GameObject.Find("spawnPointProjectile"); btnAttack = gameObject.GetComponent <Button>(); cooldownAttackScript = GameObject.Find("cooldownAttack").GetComponent <cooldownAttack>(); scoreCounter = GameObject.Find("subScoreCounter").GetComponent <scoreCounter>(); achPowerTripScript = GameObject.Find("btnBoost").GetComponent <achPowerTripper>(); }
// Use this for initialization void Start() { rdmobj = GameObject.Find("RdmGen").GetComponent <RdmObjGen>(); boostLane = GameObject.Find("BoostLane"); maincam = GameObject.Find("Main Camera"); anim = GameObject.FindGameObjectWithTag("character").GetComponent <Animation>(); btnPause = GameObject.Find("Pause"); btnShield = GameObject.Find("btnShield"); btnAttack = GameObject.Find("btnAttack"); cooldownBoostScript = GameObject.Find("cooldownBoost").GetComponent <cooldownBoost>(); }
// Use this for initialization void Start() { countText1 = GameObject.Find("ScoreText").GetComponent <Text>(); countText2 = GameObject.Find("txtScr").GetComponent <Text>(); // bonusCoinsText = GameObject.Find("txtBc").GetComponent<Text>(); objRdmobj = GameObject.Find("RdmGen"); rdmObjScript = objRdmobj.GetComponent <RdmObjGen>(); lvlUp = GetComponent <levelUp>(); count = 0; setCountText(); }
void Start() { cam = Camera.main; rdmobj = cam.gameObject.GetComponent <RdmObjGen>(); // Time.timeScale = 1f; }