//chewables
    //converts chewable to an "effects" and calls the apply effect
    public void useChewable(ChewableConfig chewable)
    {
        foreach (special chew in chewable.chewEffects)
        {
            effects newEffect = new effects(chew.type, chew.value);
            applyEffect(chew.duration, newEffect);
        }
        Debug.Log("chewable used");

        /* effects newEffect = new effects();
         * if (chewable.increaseAttack.yes)
         * {
         *  newEffect.attackValue = chewable.increaseAttack.value;
         *  //upAttack(chewable.value);
         * }
         * if (chewable.increaseDefense.yes)
         * {
         *
         *  newEffect.defenseValue = chewable.increaseDefense.value;
         *  //upDefense(chewable.value);
         * }
         * if (chewable.increaseSpeed.yes)
         * {
         *
         *  newEffect.speedValue = chewable.increaseSpeed.value;
         *  //upSpeed(chewable.value);
         * }
         * if (chewable.increasesHealth.yes)
         * {
         *
         *  newEffect.healthValue = chewable.increasesHealth.value;
         * }
         * applyEffect(chewable.chewableDuration, newEffect); */
    }
	// Use this for initialization
	void Start () {
		screenTransform = screen.GetComponent<Transform>();
		t = 0.5f;
		
		effect = Camera.main.GetComponent<effects>();
		
		screenHeight = Camera.main.orthographicSize * 2.0f;
		screenWidth = Camera.main.aspect * screenHeight;
		if(GlobalData.tutorialFromSelect)
		{
			t = 1.0f;
			float ct = EaseInOutCubicParameter(t);
			ct = 1 - ct;
			if(!audio.mute)
			{
				audio.volume = GlobalData.volume * (t - 0.5f) / 0.5f;
			}
			screenTransform.position = new Vector3(0, ct * 10, 0);
			effect.center.x = screenTransform.position.x / screenWidth + 0.5f; 
			effect.center.y = -screenTransform.position.y / screenHeight + 0.5f;
			effect.center2.x = -100;
			effect.center2.y = -100;
		}

	}
Esempio n. 3
0
	// Use this for initialization
	void Start () {
		effect = Camera.main.GetComponent<effects>();
		Camera.main.GetComponent<Shake>().ShakeCamera(0.8f, 100, 120);
		audio = GetComponent<AudioSource>();
		score = 5;//GlobalData.stars;
		beat = GlobalData.beat;
		for(int i = 0; i < 5; ++i)
		{
			if(i < score)
			{
				stars[i].SetActive(true);
			} else
			{
				stars[i].SetActive(false);
			}
		}
		time = 0;

		switch(GlobalData.selectedGod)
		{
			case GlobalData.Gods.RHINO:
				picture.GetComponent<SpriteRenderer>().sprite = SpriteManager.GetInstance().sprites["rhino_over"];
				break;
			case GlobalData.Gods.BEAR:
				picture.GetComponent<SpriteRenderer>().sprite = SpriteManager.GetInstance().sprites["bear_over"];
				break;
			case GlobalData.Gods.BULL:
				picture.GetComponent<SpriteRenderer>().sprite = SpriteManager.GetInstance().sprites["bull_over"];
				break;
		}

		hoBG = false;
		hoText = false;
		hoFist = false;
	}
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     Application.targetFrameRate = 30;
     effect = Camera.main.GetComponent<effects>();
     title.SetActive(false);
     FPSMeasureInit(30);
     balance = Camera.main.GetComponent<BalanceCamera>();
     effect.center2 = new Vector2(0.5f, 0.5f);
     menuPartsControl = menuParts.GetComponent<CustomMenuPaticles>();
     if (GlobalData.firstTime)
     {
         GlobalData.firstTime = false;
         balance.enabled = false;
         menu.transform.position = new Vector3(-10, 100,10);
         menuPartsControl.globalOffset = new Vector2(-100,0);
     }
     else
     {
         balance.enabled = true;
         headphones.SetActive(false);
         menu.transform.position = new Vector3(0,0,0);
         menuPartsControl.globalOffset = new Vector2(0,0);
         this.enabled = false;
     }
 }
Esempio n. 5
0
    // Use this for initialization
    void Start()
    {
        screenTransform = screen.GetComponent<Transform>();
        t = 1.0f;
        effect = Camera.main.GetComponent<effects>();

        screenHeight = Camera.main.orthographicSize * 2.0f;
        screenWidth = Camera.main.aspect * screenHeight;
    }
Esempio n. 6
0
    void Start()
    {
        time = 0;
        cT = transform;
        effect = Camera.main.GetComponent<effects>();

        screenHeight = Camera.main.orthographicSize * 2.0f;
        screenWidth = Camera.main.aspect * screenHeight;
    }
Esempio n. 7
0
    public static _effect Check_for_effect(_effect[] list, effects seach_for)
    {
        foreach (_effect item in list)
        {
            if (seach_for == item.effect)
            {
                return(item);
            }
        }

        return(null);
    }
    // Use this for initialization
    void Start()
    {
        screenTransform = screen.GetComponent<Transform>();
        t = 0.5f;
        if(GlobalData.tutorialFromSelect)
        {
            t = 1.0f;
        }

        effect = Camera.main.GetComponent<effects>();

        screenHeight = Camera.main.orthographicSize * 2.0f;
        screenWidth = Camera.main.aspect * screenHeight;
    }
Esempio n. 9
0
    // Use this for initialization
    void Start()
    {
        screenTransform = screen.GetComponent<Transform>();
        t = 1.0f;
        SpriteRenderer []rends = GetComponentsInChildren<SpriteRenderer>();
        for(int i = 0; i < rends.Length; ++i)
        {
            rends[i].color = GlobalData.mainColor;
        }
        particles = screen.GetComponentInChildren<CustomMenuPaticles>();

        effect = Camera.main.GetComponent<effects>();

        screenHeight = Camera.main.orthographicSize * 2.0f;
        screenWidth = Camera.main.aspect * screenHeight;
    }
	// Use this for initialization
	void Start () {
		GameObject menu = GameObject.Find("Menu");
		menuTransform = menu.GetComponent<Transform>();
		particles = menu.GetComponentsInChildren<CustomMenuPaticles>();
		GameObject credits = GameObject.Find("Credits");
		creditsParticles = credits.GetComponentsInChildren<CustomMenuPaticles>()[0];
		creditsTransform = credits.GetComponent<Transform>();
		t = 1;

		menuRectRend = menuRect.GetComponent<SpriteRenderer>();
		playRends = playButton.GetComponentsInChildren<SpriteRenderer>();
		creditRends = this.GetComponentsInChildren<SpriteRenderer>();
		effect = Camera.main.GetComponent<effects>();

		screenHeight = Camera.main.orthographicSize * 2.0f;
		screenWidth = Camera.main.aspect * screenHeight;
	}
Esempio n. 11
0
	void Awake()
	{
		effect = Camera.main.GetComponent<effects>();
		AudioSource []sources = Camera.main.GetComponents<AudioSource>();
		if(GlobalData.isMuted)
		{
			for(int i = 0; i < sources.Length; ++i)
			{
				sources[i].mute = true;
			}
		} 
		else
		{
			for(int i = 0; i < sources.Length; ++i)
			{
				sources[i].mute = false;
			}
		}
	}
    //adding active effects to sorted dictionary and apply them
    public void applyEffect(float duration, effects newEffect)
    {
        float timeSpecial = Time.time + duration;
        bool  joe         = false;

        //need to do this shit because i'm using time as a key.  probably bad coding practice, but im on a time crunch
        while (activeEffects.ContainsKey(timeSpecial))
        {
            timeSpecial += 0.1f;
        }
        if (newEffect.HealthValue != 0)
        {
            spawnChewableParticle(new Color32(103, 245, 89, 255)); // green
            upHealth(newEffect.HealthValue);
        }
        if (newEffect.DamageValue != 0)
        {
            upHealth(newEffect.DamageValue);
        }
        if (newEffect.AttackValue != 0)
        {
            spawnChewableParticle(new Color32(245, 89, 244, 255)); // purple
            upAttack(newEffect.AttackValue);
            joe = true;
        }
        if (newEffect.DefenseValue != 0)
        {
            Debug.Log("applying defense effect");
            spawnChewableParticle(new Color32(89, 230, 245, 255)); // blue
            upDefense(newEffect.DefenseValue);
            joe = true;
        }
        if (newEffect.SpeedValue != 0)
        {
            spawnChewableParticle(new Color32(245, 204, 89, 255)); // orange
            upSpeed(newEffect.DefenseValue);
            joe = true;
        }
        if (joe)
        {
            activeEffects.Add(timeSpecial, newEffect);
        }
    }
Esempio n. 13
0
    // Use this for initialization
    void Start()
    {
        GameObject menu = GameObject.Find("Menu");
        menuTransform = menu.GetComponent<Transform>();
        menuParticles = menu.GetComponentsInChildren<CustomMenuPaticles>();
        GameObject select = GameObject.Find("Song Select");
        selectTransform = select.GetComponent<Transform>();
        selectParticles = select.GetComponentInChildren<CustomMenuPaticles>();
        fromTut = false;
        mainSound.volume = GlobalData.volume;
        mainSound.Play();
        if (GlobalData.tutorialToMenu)
        {
            fromTut = true;
            t = 0.5f;
            mainSound.volume = 0.0f;
            GlobalData.tutorialToMenu = false;
        }
        else
        {
            t = 1.0f;
        }

        selectFirst = false;
        if(GlobalData.toSelectScreen)
        {
            GlobalData.toSelectScreen = false;
            selectFirst = true;

            mainSound.volume = 0.0f;
            if(!fromTut)
            {
                firstUpdate = true;
            }
            fromTut = false;
        }

        effect = Camera.main.GetComponent<effects>();

        screenHeight = Camera.main.orthographicSize * 2.0f;
        screenWidth = Camera.main.aspect * screenHeight;
    }
Esempio n. 14
0
    //Hashtable sample_offset = new Hashtable();

    void Awake()
    {
        // Connect AI manager
        ai = GameObject.Find("/manager/intelligence");
        fx = GameObject.Find("/manager/effects").GetComponent <effects>() as effects;

        currentLine["1.5"]  = "5";
        currentLine["0.5"]  = "4";
        currentLine["0"]    = "3";
        currentLine["-1"]   = "2";
        currentLine["-1.5"] = "1";

        // Offset for cursor helper
        co_helper_offset["tower"] = new Vector3(5F, 25F, 0.1F);
        co_helper_offset["oil"]   = new Vector3(180F, 50F, 0.1F);

        // Offset for grid
        grid_offset["co_sample"] = new Vector3(0.0833F, 0.0833F, 0.1F);
        grid_offset["tower"]     = new Vector3(0.0833F, 0.0833F, 0.1F);
        grid_offset["oil"]       = new Vector3(-1.3F, 0.4F, 0.1F);
    }
Esempio n. 15
0
    // Use this for initialization
    void Start()
    {
        GameObject menu = GameObject.Find("Menu");
        menuTransform = menu.GetComponent<Transform>();
        GameObject select = GameObject.Find("Song Select");
        selectTransform = select.GetComponent<Transform>();
        selectParticles = select.GetComponentsInChildren<CustomMenuPaticles>()[0];
        menuParticles = menu.GetComponentsInChildren<CustomMenuPaticles>();
        t = 1;
        if(GlobalData.startAtSelect)
        {
            GlobalData.startAtSelect = false;
            GlobalData.isSelectScreenActive = true;
            menuTransform.position = new Vector3(0, -15, 0);
            selectTransform.position = new Vector3(0, 0, 0);
        }
        effect = Camera.main.GetComponent<effects>();

        screenHeight = Camera.main.orthographicSize * 2.0f;
        screenWidth = Camera.main.aspect * screenHeight;
    }
Esempio n. 16
0
	//Hashtable sample_offset = new Hashtable();	
	
	void Awake()
	{
		// Connect AI manager
		ai = GameObject.Find("/manager/intelligence");
		fx = GameObject.Find("/manager/effects").GetComponent<effects>() as effects;
		
		currentLine["1.5"]  = "5";
		currentLine["0.5"]  = "4";
		currentLine["0"] 	= "3";
		currentLine["-1"] 	= "2";
		currentLine["-1.5"] = "1";
		
		// Offset for cursor helper
		co_helper_offset["tower"] = new Vector3(5F, 25F, 0.1F);
		co_helper_offset["oil"] =   new Vector3(180F, 50F, 0.1F);
		
		// Offset for grid
		grid_offset["co_sample"] = new Vector3(0.0833F, 0.0833F, 0.1F);
		grid_offset["tower"]  = new Vector3(0.0833F, 0.0833F, 0.1F);
		grid_offset["oil"]    = new Vector3(-1.3F, 0.4F, 0.1F);
	}
    //adding active effects to sorted dictionary and apply them
    public void applyEffect(float duration, effects newEffect)
    {
        float timeSpecial = Time.time + duration;
        bool  joe         = false;

        //need to do this shit because i'm using time as a key.  probably bad coding practice, but im on a time crunch
        while (activeEffects.ContainsKey(timeSpecial))
        {
            timeSpecial += 0.1f;
        }
        if (newEffect.HealthValue != 0)
        {
            upHealth(newEffect.HealthValue);
        }
        if (newEffect.DamageValue != 0)
        {
            upHealth(newEffect.DamageValue);
        }
        if (newEffect.AttackValue != 0)
        {
            upAttack(newEffect.AttackValue);
            joe = true;
        }
        if (newEffect.DefenseValue != 0)
        {
            upDefense(newEffect.DefenseValue);
            joe = true;
        }
        if (newEffect.SpeedValue != 0)
        {
            upSpeed(newEffect.DefenseValue);
            joe = true;
        }
        if (joe)
        {
            activeEffects.Add(timeSpecial, newEffect);
        }
    }
Esempio n. 18
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 60;
        loaded = false;
        offBeatObjects = new GameObject[2];
        offBeatObjects[0] = Instantiate(offbeat);
        offBeatObjects[1] = Instantiate(offbeat);
        offBeatObjects[0].SetActive(false);
        offBeatObjects[1].SetActive(false);

        offBeatCounter = 0;

        nextPermittedBeat = 0;
        GlobalData.GOButtonsReady = false;

        touches = new Vector3[2];
        screenHeight = Camera.main.orthographicSize * 2.0f;
        screenWidth = Camera.main.aspect * screenHeight;

        effect = Camera.main.GetComponent<effects>();
        cameraMiss = Camera.main.GetComponent<MissFrame>();
        cameraShake = Camera.main.GetComponent<Shake>();

        latestTouch = 0;
        lastTouchPosition = new Vector2(100, 100);
        fxParticles = new GameObject[2];
        fxParticles[0] = Instantiate(FXParticles);
        fxParticles[1] = Instantiate(FXParticles);
        fxParticlesControl = new CustomParticles[2];
        fxParticlesControl[0] = fxParticles[0].GetComponent<CustomParticles>();
        fxParticlesControl[1] = fxParticles[1].GetComponent<CustomParticles>();

        UpdateColors();

        fxPointer = 0;
        wrongClicks = 0;
        beat = GlobalData.beat;

        wiggleSpace = GlobalData.wiggleSpace;

        time = 0;
        god = GameObject.Find("God").GetComponent<GodDeath>();
        /* PAUSE READY
        pause = GameObject.Find("Pause").GetComponent<Pause>();
        */
        bool missed = false;
        uint oneInXMissing = 3;
        float distanceCoef = (700.0f / 500.0f);
        float expectedBunnyLifetime = GetJumpTimeFromLinearTime((350.0f / (250.0f)) * distanceCoef, beat) / (0.48f / beat);

        realDuration = 0;
        if (audio.clip)
            realDuration = audio.clip.length;
        if (percentage)
        {
            percentageS = percentage.GetComponent<Percentage>();
            percentageS.realDuration = Mathf.Floor((realDuration - expectedBunnyLifetime) / beat) * beat + expectedBunnyLifetime;
        }

        if (GOPercentage)
        {
            GOPercentageS = GOPercentage.GetComponent<Percentage>();
            GOPercentageS.realDuration = Mathf.Floor((realDuration - expectedBunnyLifetime) / beat) * beat + expectedBunnyLifetime;
        }

        float[] angles = new float[5] { Mathf.PI / 2.0f, 4.6f, 2.65f, 5.6f, 1.4f };
        if (beat == 0.375f)
        {
            oneInXMissing = 5;
        }
        effectObject = GameObject.Find("Offbeat");

        GameObject bunnObject = GameObject.Find("Bunnies");
        if (bunnObject)
        {
            bunz = bunnObject.GetComponent<Bunnies>();
        }
        GameObject screen = GameObject.Find("Screen");
        int latestColor = 0;
        Color[] colorsRhino = new Color[3]{
            new Color(0,1.0f,91.0f / 255.0f),
            new Color(0,1.0f,187.0f / 255.0f),
            new Color(144.0f / 255.0f,0,1),
        };

        Color[] colorsBear = new Color[3]{
            new Color(1,0,0),
            new Color(1,212.0f / 255.0f,0),
            new Color(1,0,110.0f / 255.0f),
        };

        Color[] colorsBull = new Color[3]{
            new Color(1.0f,0,238 / 255.0f),
            new Color(0,206 / 255.0f,229 / 255.0f),
            new Color(144 / 255.0f,0,1),
        };

        Color[] colors = null;
        switch (GlobalData.selectedGod)
        {
            case GlobalData.Gods.RHINO:
                colors = colorsRhino;
                break;
            case GlobalData.Gods.BEAR:
                colors = colorsBear;
                break;
            case GlobalData.Gods.BULL:
                colors = colorsBull;
                break;
        }

        for (int i = 0; i < maxCount; i++)
        {
            float endTime = 0;
            if (missing && (Random.Range(0, oneInXMissing)) == 0 && !missed && i > 2 && endTime < 50.0f)
            {
                missed = true;
            } else if (missed)
            {
                missed = false;
            }
            if (!missed)
            {
                GameObject bunny = null;
                if (bunz)
                {
                    bunny = bunz.bunnies[i];
                    bunny.SetActive(true);
                }
                else
                {
                    bunny = Instantiate(bunnyPrefab);
                    bunny.GetComponent<BunnyJump>().Startingu();
                    bunny.SetActive(true);
                }
                bunny.transform.parent = null;
                BunnyJump bunnyJumpS = bunny.GetComponent<BunnyJump>();
                bunnyJumpS.parentTransform = screen.transform;
                bunnyJumpS.startTime = i * beat;
                endTime = i * beat + expectedBunnyLifetime;
                bunnyJumpS.expectedBunnyLifetime = expectedBunnyLifetime;
                bunnyJumpS.beat = beat;
                bunnyJumpS.god = god;
                int randomColor = Random.Range(0, 3);
                while (randomColor == latestColor)
                {
                    randomColor = Random.Range(0, 3);
                }
                latestColor = randomColor;
                bunnyJumpS.color = colors[randomColor];
                bunnyJumpS.wiggleSpace = wiggleSpace;
                if (!randomSpawn)
                {
                    bunnyJumpS.angle = angles[i];
                }
                float scale = Random.Range(0.8f, 1.4f);
                bunny.GetComponent<Transform>().localScale = new Vector3(scale, scale, 1);
                bunnyJumpS.Init();
                bunnyCount++;
                bunnies.Add(bunnyJumpS);
            }
            if (endTime + beat > realDuration)
            {
                break;
            }
        }

        freq = 1.0f / audio.clip.frequency;

        startTime = AudioSettings.dspTime;

        minOffset = 0.0f;
        maxOffset = 0.0f;
    }
    //TODO: implement all that special shit for enemies

    //special attack stuff
    public void specialAttack()
    {
        //checks if you can use youur special
        if (chargeCount >= 3)
        {
            foreach (special special in myCoolVariable.specialEffects)
            {
                effects newEffect = new effects(special.type, special.value);
                if (special.targets == target.enemy)
                {
                    statChange marcel = new statChange();
                    marcel.duration = special.duration;
                    marcel.effects  = newEffect;
                    statChanging.Raise(marcel);
                }
                else if (special.targets == target.self)
                {
                    applyEffect(special.duration, newEffect);
                }
            }
            chargeCount = 0;
            specialUsing.Raise();
            //instantiates the effects

            /* effects selfEffects = new effects (), enemyEffects = new effects ();
             * //these are f*****g flags so we don't do random shit we dont need
             * bool don = false, john = false;
             *
             * //these basically check if the special does the thing, who it does it to and sets the flag
             *
             * if (myCoolVariable.specialDealsDamage.onDog) {
             *  enemyEffects.DamageValue = myCoolVariable.specialDealsDamage.value;
             *  don = true;
             * }
             * if (myCoolVariable.specialDealsDamage.onSelf) {
             *  selfEffects.DamageValue = myCoolVariable.specialDealsDamage.value;
             *  john = true;
             * }
             * if (myCoolVariable.specialIncreasesHealth.onDog) {
             *  enemyEffects.HealthValue = myCoolVariable.specialIncreasesHealth.value;
             *  don = true;
             * }
             * if (myCoolVariable.specialIncreasesHealth.onSelf) {
             *  selfEffects.HealthValue = myCoolVariable.specialIncreasesHealth.value;
             *  john = true;
             * }
             *
             * if (myCoolVariable.specialIncreasesAttack.onDog) {
             *  enemyEffects.AttackValue = myCoolVariable.specialIncreasesAttack.value;
             *  don = true;
             * }
             * if (myCoolVariable.specialIncreasesAttack.onSelf) {
             *  selfEffects.AttackValue = myCoolVariable.specialIncreasesAttack.value;
             *  john = true;
             * }
             * if (myCoolVariable.specialIncreasesDefense.onDog) {
             *  enemyEffects.DefenseValue = myCoolVariable.specialIncreasesDefense.value;
             *  don = true;
             * }
             * if (myCoolVariable.specialIncreasesDefense.onSelf) {
             *  selfEffects.DefenseValue = myCoolVariable.specialIncreasesDefense.value;
             *  john = true;
             * }
             * if (myCoolVariable.specialIncreasesSpeed.onDog) {
             *  enemyEffects.SpeedValue = myCoolVariable.specialIncreasesSpeed.value;
             *  don = true;
             * }
             * if (myCoolVariable.specialIncreasesSpeed.onSelf) {
             *  selfEffects.SpeedValue = myCoolVariable.specialIncreasesSpeed.value;
             *  john = true;
             * }
             * //does special effects on self
             * if (john) {
             *  applyEffect (myCoolVariable.specialDuration, selfEffects);
             * }
             * //does special effects on enemy
             * if (don) {
             *  statChange marcel = new statChange ();
             *  marcel.duration = myCoolVariable.specialDuration;
             *  marcel.effects = enemyEffects;
             *  statChanging.Raise (marcel);
             * }
             * }
             * chargeCount = 0;
             * specialUsing.Raise (); */
        }
    }
Esempio n. 20
0
    // Use this for initialization
    void Start()
    {
        time = 0;
        effect = Camera.main.GetComponent<effects>();

        #if UNITY_WP8
        PlayerPrefs.SetInt("125progress", 100);
        PlayerPrefs.SetInt("90progress", 100);
        #endif
        if(PlayerPrefs.HasKey("unlockedBear"))
        {
            GlobalData.alreadyUnlockedBear = true;
        } else
        {
            GlobalData.alreadyUnlockedBear = false;
        }

        if(PlayerPrefs.HasKey("unlockedBull"))
        {
            GlobalData.alreadyUnlockedBull = true;
        } else
        {
            GlobalData.alreadyUnlockedBull = false;
        }

        GlobalData.unlockingBear = false;
        GlobalData.unlockingBull = false;

        SetDigits[] rhinoPercentage = unlockedRhino.GetComponentsInChildren<SetDigits>();
        SetDigits[] bearPercentage = unlockedBear.GetComponentsInChildren<SetDigits>();
        SetDigits[] bullPercentage = unlockedBull.GetComponentsInChildren<SetDigits>();

        SetStars[] rhinoStars = unlockedRhino.GetComponentsInChildren<SetStars>();
        SetStars[] bearStars = unlockedBear.GetComponentsInChildren<SetStars>();
        SetStars[] bullStars = unlockedBull.GetComponentsInChildren<SetStars>();

        bool bearActive = false;
        bool bullActive = false;
        int bearProgress = 0;
        int rhinoProgress = 0;
        int bullProgress = 0;

        int rhinoStarsCount = 0;
        int bearStarsCount = 0;
        int bullStarsCount = 0;
        if(PlayerPrefs.HasKey("90stars"))
        {
            rhinoStarsCount = PlayerPrefs.GetInt("90stars");
        }
        if(PlayerPrefs.HasKey("125stars"))
        {
            bearStarsCount = PlayerPrefs.GetInt("125stars");
        }
        if(PlayerPrefs.HasKey("160stars"))
        {
            bullStarsCount = PlayerPrefs.GetInt("160stars");
        }

        if(PlayerPrefs.HasKey("90progress"))
        {
            int progress90 = PlayerPrefs.GetInt("90progress");
            if(progress90 >= 60)
            {
                bearActive = true;
                if(!GlobalData.alreadyUnlockedBear)
                {
                    GlobalData.unlockingBear = true;
                    lockedBear.SetActive(true);
                    unlockedBear.SetActive(false);
                }
                else
                {
                    lockedBear.SetActive(false);
                    unlockedBear.SetActive(true);
                }
            }
            else
            {
                lockedBear.SetActive(true);
                unlockedBear.SetActive(false);
            }
            rhinoProgress = progress90;
        }
        else
        {
            lockedBear.SetActive(true);
            unlockedBear.SetActive(false);
        }

        if(PlayerPrefs.HasKey("125progress"))
        {
            int progress125 = PlayerPrefs.GetInt("125progress");
            if(progress125 >= 60)
            {
                bullActive = true;
                if(!GlobalData.alreadyUnlockedBull)
                {
                    GlobalData.unlockingBull = true;
                    lockedBull.SetActive(true);
                    unlockedBull.SetActive(false);
                } else
                {
                    lockedBull.SetActive(false);
                    unlockedBull.SetActive(true);
                }
            }
            else
            {
                lockedBull.SetActive(true);
                unlockedBull.SetActive(false);
            }
            bearProgress = progress125;
        }
        else
        {
            lockedBull.SetActive(true);
            unlockedBull.SetActive(false);
        }

        if(PlayerPrefs.HasKey("160progress"))
        {
            int progress160 = PlayerPrefs.GetInt("160progress");
            bullProgress = progress160;
        }

        rhinoPercentage[0].SetNumber(rhinoProgress);
        rhinoStars[0].SetStarsActive(rhinoStarsCount);
        if(bearActive)
        {
            bearPercentage[0].SetNumber(bearProgress);
            bearStars[0].SetStarsActive(bearStarsCount);
        }
        if(bullActive)
        {
            bullPercentage[0].SetNumber(bullProgress);
            bullStars[0].SetStarsActive(bullStarsCount);
        }

        cameraShake = Camera.main.GetComponent<Shake>();

        if (bearActive && bullActive && rhinoProgress == 100 && bearProgress == 100 && bullProgress == 100)
        {
            if (PlayerPrefs.HasKey("ctaShown"))
            {
                badgeButton.SetActive(true);
                ctaButton.SetActive(false);
                ctaBG.SetActive(false);
            }
            else
            {
                badgeButton.SetActive(false);
                ctaButton.SetActive(true);
                ctaBG.SetActive(true);
            }

        }
        else
        {
            badgeButton.SetActive(false);
            ctaButton.SetActive(false);
            ctaBG.SetActive(false);
        }
    }
Esempio n. 21
0
	void Start () {
		Application.targetFrameRate = 60;

		shake = Camera.main.GetComponent<Shake>();
		effect = Camera.main.GetComponent<effects>();
		

		particles.transform.position = new Vector3(0,0,0);
		particlesControl = particles.GetComponent<CustomParticles>();
		length = timeSource.clip.length;
		d1 = num1.GetComponent<SpriteRenderer>();
		d2 = num2.GetComponent<SpriteRenderer>();
		cTransform = num1.GetComponent<Transform>();
		beat = GlobalData.beat;
		currentCount = Mathf.FloorToInt(length / beat);
		freq = 1.0f / timeSource.clip.frequency;
		timeSource.Play();

		wiggleSpace = GlobalData.wiggleSpace;

		offBeatObjects = new GameObject[2];
		offBeatObjects[0] = Instantiate(offbeat);
		offBeatObjects[1] = Instantiate(offbeat);
		offBeatObjects[0].SetActive(false);
		offBeatObjects[1].SetActive(false);

		offBeatCounter = 0;
		effectObject = GameObject.Find("Offbeat");

		fxParticles = new GameObject[2];
		fxParticles[0] = Instantiate(FXParticles);
		fxParticles[1] = Instantiate(FXParticles);
		fxParticlesControl = new CustomParticles[2];
		fxParticlesControl[0] = fxParticles[0].GetComponent<CustomParticles>();
		fxParticlesControl[1] = fxParticles[1].GetComponent<CustomParticles>();


		switch(GlobalData.selectedGod)
		{
			case GlobalData.Gods.RHINO:
					fxParticlesControl[0].SetColors(rhinoColors1);
					fxParticlesControl[1].SetColors(rhinoColors1);
					break;
				case GlobalData.Gods.BEAR:
					fxParticlesControl[0].SetColors(bearColors1);
					fxParticlesControl[1].SetColors(bearColors1);
					break;
				case GlobalData.Gods.BULL:
					fxParticlesControl[0].SetColors(bullColors1);
					fxParticlesControl[1].SetColors(bullColors1);
				break;
		}
	}
Esempio n. 22
0
 void Start()
 {
     shake = Camera.main.GetComponent<Shake>();
     effectz = Camera.main.GetComponent<effects>();
 }
 //reverses stat changes
 public void endStatChanges(effects bradley)
 {
     upAttack(-bradley.AttackValue);
     upDefense(-bradley.DefenseValue);
     upSpeed(-bradley.SpeedValue);
 }
Esempio n. 24
0
    // Use this for initialization
    void Start()
    {
        bioMode = false;
        GameObject menu = GameObject.Find("Menu");
        menuTransform = menu.GetComponent<Transform>();
        menuParticles = menu.GetComponentsInChildren<CustomMenuPaticles>();
        GameObject select = GameObject.Find("Song Select");
        selectParticles = select.GetComponentsInChildren<CustomMenuPaticles>()[0];
        selectTransform = select.GetComponent<Transform>();
        t = 1;

        effect = Camera.main.GetComponent<effects>();

        screenHeight = Camera.main.orthographicSize * 2.0f;
        screenWidth = Camera.main.aspect * screenHeight;
    }