protected override void Awake() { base.Awake(); ninstance = this; SetCameraOffset(Vector3.one); SetCameraYawClamp(I_PitchMin, I_PitchMax); m_SelfRotation = true; f_fovStart = m_Camera.fieldOfView; f_fovCurrent = f_fovStart; }
void InitFPSCamera() { if (CameraJoint != null && FPSCamera == null) { FPSCamera = CameraJoint.GetComponentInChildren <FPSCameraController>(); if (FPSCamera == null) { FPSCamera = (Camera.main != null) ? Camera.main.GetComponent <FPSCameraController>() : null; if (FPSCamera != null) { FPSCamera.transform.SetParent(CameraJoint); FPSCamera.transform.localPosition = Vector3.zero; FPSCamera.transform.rotation = CameraJoint.rotation; } } } }
void Start() { audioSource = GetComponent <AudioSource> (); rb = GetComponent <Rigidbody> (); playerColl = GetComponent <CapsuleCollider> (); camController = GetComponentInChildren <FPSCameraController> (); input = InputManager.instance; level = LevelManager.instance; uiManager = UIManager.instance; ResetYaw(); isCrouching = false; isJumpingOver = false; canJumpOver = false; height = heightSettings.maximumHeight; level.HideCursor(); contactNormals = new List <Vector3> (); landingPosition = this.transform.position; }
private void Awake() { inventoryUI = transform.Find("InventoryUI").gameObject; slots = transform.Find("InventoryUI").GetComponentsInChildren <InventorySlot>(); fpsCameraController = Camera.main.GetComponent <FPSCameraController>(); }