Пример #1
0
    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;
    }
Пример #2
0
 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;
             }
         }
     }
 }
Пример #3
0
 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;
 }
Пример #4
0
 private void Awake()
 {
     inventoryUI         = transform.Find("InventoryUI").gameObject;
     slots               = transform.Find("InventoryUI").GetComponentsInChildren <InventorySlot>();
     fpsCameraController = Camera.main.GetComponent <FPSCameraController>();
 }