Inheritance: UnityStandardAssets.Cameras.PivotBasedCameraRig
Ejemplo n.º 1
0
        protected override void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Destroy(gameObject);//only one exist
            }

            base.Awake();
            // Lock or unlock the cursor.
            Cursor.lockState = m_LockCursor ? CursorLockMode.Locked : CursorLockMode.None;
            Cursor.visible   = !m_LockCursor;
            m_PivotEulers    = m_Pivot.rotation.eulerAngles;

            m_PivotTargetRot     = m_Pivot.transform.localRotation;
            m_TransformTargetRot = transform.localRotation;
        }
Ejemplo n.º 2
0
        protected override void Awake()
        {
            base.Awake();
            // Lock or unlock the cursor.
            Cursor.lockState = lockCursor ? CursorLockMode.Locked : CursorLockMode.None;
            Cursor.visible   = !lockCursor;
            m_PivotEulers    = m_Pivot.rotation.eulerAngles;

            m_PivotTargetRot     = m_Pivot.transform.localRotation;
            m_TransformTargetRot = transform.localRotation;

            m_OriginalDist    = m_Cam.localPosition.magnitude;
            m_CurrentDist     = m_OriginalDist;
            m_CurrentZoomDist = m_CurrentDist;

            if (wallClipProtector == null)
            {
                wallClipProtector = GetComponent <ProtectCameraFromWallClip>();
            }

            Singleton = this;
        }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     cam    = Camera.main.transform;
     camScr = GetComponent <UnityStandardAssets.Cameras.FreeLookCam>();
 }