Exemplo n.º 1
0
        public override void OnStartLocalPlayer()
        {
            //Setup UI
            ClientUI clientUi = Instantiate(clientUiPrefab).GetComponent <ClientUI>();

            clientUi.SetupUI(playerManager);
            gameObject.AddComponent <PlayerUIManager>().Setup(clientUi);

            //Allows for custom messages
            gameObject.AddComponent <PlayerServerMessages>();

            foreach (MeshRenderer gfxMesh in gfxMeshes)
            {
                gfxMesh.enabled = false;
            }

            //Set up scene stuff
            playerVCam.enabled = true;

            //Player Input
            gameObject.AddComponent <PlayerInputManager>().Setup();

            //Lock the cursor
            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;
        }
Exemplo n.º 2
0
        public override void OnStartLocalPlayer()
        {
            //Setup UI
            ClientUI clientUi = Instantiate(clientUiPrefab).GetComponent <ClientUI>();

            clientUi.SetupUI(playerManager);
            gameObject.AddComponent <PlayerUIManager>().Setup(clientUi);

            //Allows for custom messages
            gameObject.AddComponent <PlayerServerMessages>();

            base.OnStartLocalPlayer();

            //Set up scene stuff
            GameManager.GetActiveSceneCamera().SetActive(false);
            localCamera.enabled = true;
            localCamera.gameObject.AddComponent <AudioListener>();

            //Player Input
            gameObject.AddComponent <PlayerInput>().Setup(inputReader);

            //Lock the cursor
            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;
        }