//
    void Start()
    {
        //Initizalize
        LoadData();
        //Should i destroy the blocks? (Dependes on the int destroyBlock)
        if (destroyBlock >= 5)
        {
            Destroy(block1.gameObject);
        }

        if (destroyBlock >= 10)
        {
            Destroy(block2.gameObject);
        }

        if (destroyBlock >= 15)
        {
            Destroy(block3.gameObject);
            Destroy(survivorBlock.gameObject);
        }

        if (destroyBlock >= 20)
        {
            Destroy(block4.gameObject);
        }

        if (destroyBlock >= 25)
        {
            Destroy(block5.gameObject);
        }

        if (destroyBlock >= 30)
        {
            Destroy(block6.gameObject);
        }

        if (destroyBlock >= 35)
        {
            Destroy(block7.gameObject);
        }

        if (destroyBlock >= 40)
        {
            Destroy(block8.gameObject);
        }
        scoreScreen.SetActiveRecursively(false);
        soundScript = Camera.mainCamera.GetComponent<SoundManager>();
        menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
        soundScript.PlaySound(21, true, 1f);
    }
示例#2
0
 void Start()
 {
     menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
     soundScript = Camera.mainCamera.GetComponent<SoundManager>();
 }
示例#3
0
 void Start()
 {
     thisMesh = this.gameObject.GetComponent<TextMesh>();
     menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
 }
示例#4
0
    void Start()
    {
        //if its the ray balloons, we have to initialize it with a color
        if (Idballoon == "theray")
        {
            randomRayColor = Random.Range(0, 4);

            if (randomRayColor == 0)
            {
                this.renderer.material.mainTexture = redBalloon;
            }
            else
            {
                if (randomRayColor == 1)
                {
                    this.renderer.material.mainTexture = greenBalloon;
                }
                else
                {
                    if (randomRayColor == 2)
                    {
                        this.renderer.material.mainTexture = blueBalloon;
                    }
                    else
                    {
                        if (randomRayColor == 3)
                        {
                            this.renderer.material.mainTexture = yellowBalloon;
                        }
                    }
                }
            }
        }
        //

        //If its the refresher (we have to destroy it cause if not, the user will use it his own benefit benefit forever)
        if (Idballoon == "orange")
        {
            Destroy(this.gameObject, 7);
        }
        //

        //Initialize
        faceManager = this.GetComponentInChildren<FaceManager>();
        menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
        soundScript = Camera.mainCamera.GetComponent<SoundManager>();
        score = GameObject.FindWithTag("Score");
        scoreScript = score.GetComponent<ScoreManipulator>();
        maxAcc = 0.5f;
        aceleration = -1;
        //
    }
示例#5
0
 void Start()
 {
     menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
     ballonScript = gameObject.transform.root.GetComponent<Balloon>();
 }
示例#6
0
    // Update is called once per frame
    void Update()
    {
        if (thisIsGrayToo)
        {
            menuScript = Camera.mainCamera.gameObject.GetComponent<MenuManipulator>();
            if (startThunder)
            {
                if (!once)
                {
                    randomThunder = Random.Range(0, 3);
                    if (randomThunder == 0)
                    {
                        soundScript.PlaySound(32, false, 0.5f);
                    }
                    once = true;
                }
                if (randomThunder == 0)
                {
                    if (showThunder < 0.1f)
                    {

                        thundereffect.renderer.enabled = true;
                        thunder.collider.enabled = true;
                        thunder.renderer.enabled = true;
                        showThunder += Time.deltaTime;
                    }
                    else
                    {
                        randomThunder = 1;
                        once = false;
                    }
                }
                else
                {
                    once = false;
                    thundereffect.renderer.enabled = false;
                    thunder.renderer.enabled = false;
                    thunder.collider.enabled = false;
                    showThunder = 0;
                    timeThunder = 0;
                    startThunder = false;
                }
            }
            if (menuScript.inStorm)
            {
                if (timeThunder < 5)
                {
                    timeThunder += Time.deltaTime;
                }
                else
                {
                    startThunder = true;
                }
                this.renderer.material.mainTexture = stormTxt;
            }
            else
            {
                thundereffect.renderer.enabled = false;
                thunder.renderer.enabled = false;
                thunder.collider.enabled = false;
                this.renderer.material.mainTexture = niceTxt;
            }
        }

        if (cloudId == 0)
        {
            this.transform.position += transform.right * speed * Time.deltaTime;
        }
        if (cloudId == 1)
        {
            this.transform.position += transform.right * -speed * Time.deltaTime;
        }
        if (cloudId == 2)
        {
            this.transform.position += transform.right * -speed * Time.deltaTime;
        }
    }
 void Start()
 {
     menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
     timerEnd = 6;
     //We instanciate some balloons
     for (int i=0;i<ballonList.Count;i++)
     {
         if (i == 0)
         {
             GameObject blue = (GameObject)GameObject.Instantiate(ballonList[0]);
             blueBalloons.Add(blue);
             allBalloons.Add(blue);
         }
         if (i == 1)
         {
             GameObject green = (GameObject)GameObject.Instantiate(ballonList[1]);
             greenBalloons.Add(green);
             allBalloons.Add(green);
         }
         if (i == 2)
         {
             GameObject red = (GameObject)GameObject.Instantiate(ballonList[2]);
             redBalloons.Add(red);
             allBalloons.Add(red);
         }
         if (i == 3)
         {
             GameObject yellow = (GameObject)GameObject.Instantiate(ballonList[3]);
             yellowBalloons.Add(yellow);
             allBalloons.Add(yellow);
         }
         ballonList[i].transform.position = new Vector3(Random.Range(this.transform.position.x - 10, this.transform.position.x + 10), Random.Range(this.transform.position.y - 0.1f, this.transform.position.y + 0.1f),0);
     }
     //
 }
 void Start()
 {
     menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
     score = GameObject.FindWithTag("Score");
     scoreScript = score.GetComponent<ScoreManipulator>();
 }
示例#9
0
 void Start()
 {
     bManager = balloonsManager.GetComponent<BallonManager>();
     menuScript = Camera.mainCamera.GetComponent<MenuManipulator>();
     scoreScript = score.GetComponent<ScoreManipulator>();
 }