// Use this for initialization
    void Start()
    {
        SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex(7));

        m_currState = GameState.Setup;

        m_hammers = new List <GameObject>();

        m_spawner = new float[SPAWNERS];

        for (int i = 0; i < SPAWNERS; i++)
        {
            m_spawner[i] = Random.Range(0.1f, maxSpawnTime);
        }

        FloatingTextManager.Initialise();


        m_playerIDObject = GameObject.FindGameObjectWithTag("Player");
        m_overworldGM    = GameObject.FindGameObjectWithTag("GameManager");

        //m_clientID = m_playerIDObject.GetComponent<CustomLobby>().playerDetails.Identifier;



        newCanvas = Instantiate(tutorialCanvas, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity);

        m_background     = GameObject.FindGameObjectWithTag("Background");
        tutorialTimerTxt = GUIText.FindObjectOfType <Text>();


        m_gameTime = startTime;

        m_isOldTouch = false;
    }
    //start function
    void Start()
    {
        SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex(5));
        //FadeOutAnimation = GameObject.Find("FadeOut").GetComponent<StopAnimationScript>();
        FadeInAnimation = GameObject.Find("FadeIn").GetComponent <StopAnimationScript> ();
        fade.SetActive(false);



        newCanvas       = Instantiate(tutorialCanvas, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity);
        tutorialTimeTxt = GUIText.FindObjectOfType <Text>();

        //if the background music prefab isnt in the scene then it will not try and search for it
        if (GameObject.FindGameObjectWithTag("BGMusic") != null)
        {
            backgroundMusic = GameObject.FindGameObjectWithTag("BGMusic");
            m_musicFadeOut  = backgroundMusic.GetComponent <MusicFadeOut>();
        }
        //initialise timer
        m_gameTimer = (int)gameDuration;

        //floating text manager public static utility class initialisation
        FloatingTextManager.Initialise();

        //set up screen orientation and plant grid
        Screen.orientation = ScreenOrientation.Landscape;

        //get the component stuff from the portait prefabs
        //Player1Stats = Player1.GetComponent<PortaitScript> ();
        //Player2Stats = Player2.GetComponent<PortaitScript> ();
        //Player3Stats = Player3.GetComponent<PortaitScript> ();
        // Player4Stats = Player4.GetComponent<PortaitScript> ();
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex(6));
        // Set Client ID
        // Set Portraits
        // Set Powerup state
        playerScore = 0.0f;
        m_currState = GAMESTATE.Start;

        m_pedObjects = new List <GameObject>();

        m_spawnTimer    = new float[maxZDist - minZDist];
        m_spawnRateRand = new float[maxZDist - minZDist];

        for (int i = 0; i < maxZDist - minZDist; i++)
        {
            m_spawnRateRand[i] = Random.Range(spawnRateMin, spawnRateMax);
        }

        // Call start menu
        //        StartMenu();

        m_musicFadeOut = backgroundMusic.GetComponent <MusicFadeOut>();



        portraits = GameObject.FindGameObjectsWithTag("Portrait");

        newCanvas = Instantiate(tutorialCanvas, new Vector3(0.0f, 0.0f, 0.0f), Quaternion.identity);

        tutorialTimerTxt = GUIText.FindObjectOfType <Text>();



        //Iterate through the length of the portrait scripts
        for (int i = 0; i < portraits.Length; i++)
        {
            //add the portraits locally
            portraitScripts.Add(portraits [i].GetComponent <PortaitScript> ());

            //find the local player ad set it to the relative portrait
            if (portraitScripts [i].IsLocalPlayerPortrait())
            {
                localPortrait = portraitScripts [i];
            }
        }


        handSpawnScript = handSpawn.GetComponent <HandSpawn> ();
    }
Esempio n. 4
0
 void Update()
 {
     if (updatetimer == 50)
     {
         updatetimer = 0;
         ((GUIText)(GUIText.FindObjectOfType(typeof(GUIText)))).text = "Death: " + Deaths.ToString();
         foreach (Person p in People)
         {
             if (p.Update())
             {
                 Deaths++;
             }
         }
     }
     else
     {
         updatetimer++;
     }
 }