Ejemplo n.º 1
0
    void Awake()
    {
        Instance = this;

        Time.timeScale      = MinimumTimeScale; // Set Time.timeScale to slowest possible value.
        Time.fixedDeltaTime = 0.005f;           // Setting initial fixed time step.
    }
Ejemplo n.º 2
0
    void FindComponents()
    {
        ScreenOverlayScript = Camera.main.GetComponent <ScreenOverlay> ();

        // Finds the rigidbody this script is attached to.
        rb = GetComponent <Rigidbody> ();

        // Finds Game Controller script.
        gameControllerScript = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController> ();

        // Finds Player Mesh Collider (note collider and mesh comonents are two different GameObjects).
        PlayerCollider = GameObject.Find("Collider").GetComponent <MeshCollider>();

        // Finds Player Mesh Renderer
        if (isClone == false)
        {
            PlayerMesh = GameObject.FindGameObjectWithTag("PlayerMesh").GetComponent <MeshRenderer> ();
        }

        // Timescale controller script.
        timeScaleControllerScript = GameObject.FindGameObjectWithTag("TimeScaleController").GetComponent <TimescaleController> ();

        // Finds color correction curves script.
        ColorCorrectionCurvesScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <ColorCorrectionCurves>();

        // Finds Camera Shake script.
        if (GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera> ().enabled == true && isClone == false)
        {
            camShakeScrpt = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraShake> ();
            LensScript    = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Lens> ();
        }

        Shafts = GameObject.FindGameObjectWithTag("Shafts");
    }
Ejemplo n.º 3
0
    void FindComponents()
    {
        // Finds scripts.
        timeScaleControllerScript  = GameObject.FindGameObjectWithTag("TimeScaleController").GetComponent <TimescaleController> ();
        playerControllerScript     = GameObject.Find("Player").GetComponent <PlayerController> ();
        brickStackControllerScript = GameObject.FindGameObjectWithTag("BrickStackController").GetComponent <BrickStackController> ();
        MouseScript = GameObject.FindGameObjectWithTag("GlobalMouseController").GetComponent <GlobalMouseVisibility>();

        // Finds Player transform.
        Player = GameObject.FindGameObjectWithTag("Player").transform;
    }
Ejemplo n.º 4
0
    void FindComponents()
    {
        ScoreText              = GameObject.FindGameObjectWithTag("ScoreText").GetComponent <Animator> ();
        gameControllerScript   = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController> ();
        timeController         = GameObject.FindGameObjectWithTag("TimeScaleController").GetComponent <TimescaleController> ();
        PlayerControllerScript = GameObject.Find("Player").GetComponent <PlayerController>();

        // Finding the main engine particle system GameObject.
        GameObject MainEngine = GameObject.FindGameObjectWithTag("MainEngine");

        MainEngineParticles = MainEngine.GetComponent <ParticleSystem> ();

        if (PlayerControllerScript.Health >= 25 && isTutorialPart == false)
        {
            playerMesh = GameObject.FindGameObjectWithTag("PlayerMesh").GetComponent <MeshRenderer> ();
        }
    }
Ejemplo n.º 5
0
    void FindComponents()
    {
        ScoreText = GameObject.FindGameObjectWithTag 			("ScoreText").			GetComponent 			<Animator> ();
        gameControllerScript = GameObject.FindGameObjectWithTag ("GameController").		GetComponent 			<GameController> ();
        timeController = GameObject.FindGameObjectWithTag 		("TimeScaleController").GetComponent 			<TimescaleController> ();
        PlayerControllerScript = GameObject.Find 				("Player").				GetComponent 			<PlayerController>();

        // Finding the main engine particle system GameObject.
        GameObject MainEngine = GameObject.FindGameObjectWithTag ("MainEngine");
        MainEngineParticles = MainEngine.GetComponent<ParticleSystem> ();

        if (PlayerControllerScript.Health >= 25 && isTutorialPart == false)
        {
            playerMesh = GameObject.FindGameObjectWithTag ("PlayerMesh").GetComponent<MeshRenderer> ();
        }
    }
    void FindComponents()
    {
        ScreenOverlayScript = Camera.main.GetComponent<ScreenOverlay> ();

        // Finds the rigidbody this script is attached to.
        rb = GetComponent<Rigidbody> ();

        // Finds Game Controller script.
        gameControllerScript = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameController> ();

        // Finds Player Mesh Collider (note collider and mesh comonents are two different GameObjects).
        PlayerCollider = GameObject.Find ("Collider").GetComponent<MeshCollider>();

        // Finds Player Mesh Renderer
        if (isClone == false)
        {
            PlayerMesh = GameObject.FindGameObjectWithTag ("PlayerMesh").GetComponent<MeshRenderer> ();
        }

        // Timescale controller script.
        timeScaleControllerScript = GameObject.FindGameObjectWithTag ("TimeScaleController").GetComponent<TimescaleController> ();

        // Finds color correction curves script.
        ColorCorrectionCurvesScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<ColorCorrectionCurves>();

        // Finds Camera Shake script.
        if (GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<Camera> ().enabled == true && isClone == false)
        {
            camShakeScrpt = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<CameraShake> ();
            LensScript = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<Lens> ();
        }

        Shafts = GameObject.FindGameObjectWithTag ("Shafts");
    }
    void FindComponents()
    {
        // Finds scripts.
        timeScaleControllerScript = GameObject.FindGameObjectWithTag ("TimeScaleController").GetComponent<TimescaleController> ();
        playerControllerScript = GameObject.Find ("Player").GetComponent<PlayerController> ();
        brickStackControllerScript = GameObject.FindGameObjectWithTag ("BrickStackController").GetComponent<BrickStackController> ();
        MouseScript = GameObject.FindGameObjectWithTag ("GlobalMouseController").GetComponent<GlobalMouseVisibility>();

        // Finds Player transform.
        Player = GameObject.FindGameObjectWithTag ("Player").transform;
    }