private void InitializeLocalPlayer() { // Create input component. localPlayerInput = localPlayer.GameObject.AddComponent <ClientPlayerInput>(); localPlayerInput.DebugAutoMovement = debugAutoMovement; // Setup camera and attach to the local player camera anchor. var cpmCamera = Camera.main.gameObject.AddComponent <CPMCameraController>(); cpmCamera.player = localPlayer.Controller as CPMPlayerController; // Inject the attack handler. localPlayer.Controller.SetPlayerAttackDelegate(HandleLocalPlayerAttack); // Disable the Player View for the local player so we don't see ourselves. var localView = Ice.ObjectUtil.FindChildWithTag(localPlayer.GameObject, "PlayerView"); if (localView != null) { localView.SetActive(false); } }
private void Start() { playerController = player.GetComponent <IPlayerController>(); clientPlayerInput = GetComponent <ClientPlayerInput>(); }