Esempio n. 1
0
 private void SetScreenFaderRef()
 {
     fadeScreenManager = FindObjectOfType <FadeScreenManager>();
 }
    /*
    private bool justPushedUp = false;

    private bool justPushedDown = false;

    private bool justPushedLeft = false;

    private bool justPushedRight = false;
    */

	// Use this for initialization
	void Start ()
    {
        sphereBody = GetComponent<Rigidbody>();

        playerMesh = GetComponent<MeshRenderer>();

        collisionAudioSource = GetComponent<AudioSource>();

        // Get the fade image class
        fadeImageRef = FindObjectOfType<FadeScreenManager>();

        pushDownForce = pushDownForce * -1;

        pushLeftForce = pushLeftForce * -1;

        // Hide the player's mouse cursor
        if (Application.isEditor)
        {
            Cursor.visible = true;
        }
        else
        {
            Cursor.visible = false;
        }

        // Set the respawn point for the player
        setRespawnPoint();

        // Reference all level pickups
        getPickups();

        // Reference the gameManager
        getGameManager();

        // Disable the player's physics properties
        setPlayerPhysics(false);
        sphereBody.useGravity = false;

        // Set collision audio
        setCollisionClip();
	}
 private void SetRef()
 {
     bomb      = bombRef.GetComponent <Bomb>();
     screenRef = FindObjectOfType <FadeScreenManager>();
 }