Beispiel #1
0
    //This method takes 3 arrays and goes through them to display a full conversation
    //between blobs. It changes color and display time based upon what is set in the array.

    public IEnumerator specialWait(string [] messages, int [] times, Color [] colors)
    {
        print(messages.Length);

        for (var i = 0; i < messages.Length; i++)
        {
            if (isSkip)
            {
                i = messages.Length;
                break;
            }
            centerText.color = colors [i];
            centerText.text  = messages [i];

            int waitTime = times [i];
            yield return(new WaitForSeconds(waitTime));
        }


        //switch back to normal view
        centerText.text = "";
        MovieCamera script = GameObject.Find("SecondaryCamera").GetComponent <MovieCamera> ();

        script.SetCharCam();

        //if the game is over, load the main menu
        if (isEnd)
        {
            Cursor.visible   = true;
            Cursor.lockState = CursorLockMode.Confined;
            Application.LoadLevel("MainMenu");
        }
    }
Beispiel #2
0
    void MovieSetup()
    {
        //get secondary camera
        Camera movieCam = GameObject.Find("SecondaryCamera").GetComponent <Camera> ();

        //set location
        movieCam.transform.position = new Vector3(86, 5, -34);

        //set camera view
        MovieCamera cameraScript = GameObject.Find("SecondaryCamera").GetComponent <MovieCamera> ();

        cameraScript.SetMovieCam();
    }
Beispiel #3
0
    //This method is called when the player saves Grandblob!
    void YouWin()
    {
        //destroy all the seeds
        GameObject[] seeds = GameObject.FindGameObjectsWithTag("seed");
        foreach (GameObject seedObj in seeds)
        {
            Destroy(seedObj);
        }

        //play the last cutscene
        MovieSetup();
        MovieCamera cameraScript = GameObject.Find("SecondaryCamera").GetComponent <MovieCamera> ();

        cameraScript.EndingSequence();
    }
Beispiel #4
0
    //GotASeed is called when the player picks up a seed. It increments the amount of seeds
    //they currently have. If it is the first collected seed, it plays instructions
    public void GotASeed(GameObject aSeed)
    {
        if (aSeed.tag == "waterSeed")
        {
            //destroy the things around the seed
            GameObject[] waterPlaces = GameObject.FindGameObjectsWithTag("waterPlace");
            for (var i = 0; i < waterPlaces.Length; i++)
            {
                Vector3 waterPlacePos = waterPlaces [i].transform.position;
                if (Vector3.Distance(transform.position, waterPlacePos) <= MIN_DIST)
                {
                    Destroy(waterPlaces [i]);
                    //if the water place is destroyed, on trigger exit is NOT called, but we need to
                    //change the power back
                    blobPlayer.SetState("ice");
                    temp.setTemp(0);
                }
            }
        }
        else if (aSeed.tag == "vaporSeed")
        {
            //destroy the things around the seed
            GameObject[] vaporPlaces = GameObject.FindGameObjectsWithTag("vaporPlace");
            for (var i = 0; i < vaporPlaces.Length; i++)
            {
                Vector3 waterPlacePos = vaporPlaces [i].transform.position;
                if (Vector3.Distance(transform.position, waterPlacePos) <= MIN_DIST)
                {
                    Destroy(vaporPlaces [i]);
                    //if the vapor place is destroyed, on trigger exit is NOT called, but we need to
                    //change the power back
                    blobPlayer.SetState("ice");
                    temp.setTemp(0);
                    numSeeds++;
                }
            }
        }

        numSeeds++;
        if (isFirst)
        {
            MovieCamera movieScript = GameObject.Find("SecondaryCamera").GetComponent <MovieCamera> ();
            movieScript.SeedInstructions();
            isFirst = false;
        }
    }
Beispiel #5
0
 //Play certain animations
 void OnTriggerEnter(Collider other)
 {
     if (cutscene1)
     {
         MovieSetup();
         MovieCamera cameraScript = GameObject.Find("SecondaryCamera").GetComponent <MovieCamera> ();
         cameraScript.grandpaCutscene();
     }
     else if (other.gameObject.tag == "seed")
     {
         //GrandBlob dialogue when he is feeling a bit warmer
         GameObject UICanvas = GameObject.Find("UICanvas");
         UI         uiScript = UICanvas.GetComponent <UI>();
         uiScript.Dialog("T-t-that's a b-b-bit... Warmer.");
     }
     else
     {
         //GrandBlob dialogue
         GameObject UICanvas = GameObject.Find("UICanvas");
         UI         uiScript = UICanvas.GetComponent <UI>();
         uiScript.Dialog("*shiver shiver*");
     }
 }
Beispiel #6
0
    //Play certain animations
    void OnTriggerEnter(Collider other)
    {
        if (cutscene)
        {
            //get secondary camera
            Camera movieCam = GameObject.Find("SecondaryCamera").GetComponent <Camera> ();

            //set location?
            movieCam.transform.position = new Vector3(-59, 5, -50);

            //set camera view
            MovieCamera cameraScript = GameObject.Find("SecondaryCamera").GetComponent <MovieCamera> ();
            cameraScript.SetMovieCam();
            cameraScript.LibraryCutscene();
        }
        else
        {
            //Print generic dialogue
            GameObject UICanvas = GameObject.Find("UICanvas");
            UI         uiScript = UICanvas.GetComponent <UI>();
            uiScript.Dialog("Good luck saving your Grandblob.");
        }
    }