コード例 #1
0
 void Awake( )
 {
     _play_camera       = new PlayCamera( );
     _event_camera      = new EventCamera( );
     _stage_view_camera = new StageViewCamera( );
     _camera_mode       = CAMERA_MODE.PLAY;
     _camera_slider     = GameObject.Find("CameraSlider");
 }
コード例 #2
0
ファイル: ChangEventCamrea.cs プロジェクト: yutongzhu/UtoVR
 public void ChangeCamera(EventCamera camera)
 {
     for (int i = 0; i < canvasList.Count; i++)
     {
         if (eventCamera == EventCamera.SingleCamera)
         {
             singleCamera.gameObject.SetActive(true);
             Pvr_UnitySDK.SetActive(false);
             ControllerManager.gameObject.SetActive(false);
             canvasList[i].worldCamera = singleCamera;
         }
         else
         {
             singleCamera.gameObject.SetActive(false);
             Pvr_UnitySDK.SetActive(true);
             ControllerManager.gameObject.SetActive(true);
             canvasList[i].worldCamera = VrCamera;
         }
     }
 }
コード例 #3
0
        private void Awake()
        {
            // Check if HandCursor exist and if not, add it.
            var cursor = GetComponent <HandCursor>();

            if (cursor == null)
            {
                gameObject.AddComponent <HandCursor>();
            }

            if (_eventCamera == null)
            {
                _eventCamera = FindObjectOfType <EventCamera>();
            }

            _handProvider = FindObjectOfType <HandsProvider>();

            _palmState.OnHoverEnter += HoverStart;
            _palmState.OnHoverExit  += HoverEnd;
            _palmState.OnGrabStart  += GrabStart;
            _palmState.OnGrabEnd    += GrabEnd;
            _handObjectReferences    = metaContext.Get <HandObjectReferences>();
            _palmState.Initialize();
        }
コード例 #4
0
        private void Update()
        {
            EventCamera.transform.position = Vector3.SmoothDamp(
                EventCamera.transform.position,
                transform.position,
                ref _cameraVelocity,
                _pointerPositionDamp);

            _currentRotationDamp = Mathf.MoveTowards(_currentRotationDamp, _pointerRotationDamp, Time.deltaTime);
            float delta = Quaternion.Angle(EventCamera.transform.rotation, transform.rotation);

            EventCamera.transform.rotation = Quaternion.RotateTowards(
                EventCamera.transform.rotation,
                transform.rotation,
                (Time.deltaTime * delta) / _currentRotationDamp
                );

            Vector2 priorScreenPoint = EventCamera.WorldToScreenPoint(_priorWorldPosition);

            DeltaInScreen = PositionInCamera() - priorScreenPoint;
            Ray ray = EventCamera.ScreenPointToRay(PositionInCamera());

            _priorWorldPosition = ray.GetPoint(.01f);
        }
コード例 #5
0
ファイル: Hit_Over.cs プロジェクト: Hikka1204/competition2020
 // Start is called before the first frame update
 void Start()
 {
     FirstPerson  = GetComponent <UnityStandardAssets.Characters.FirstPerson.FirstPersonController>();
     cameraobject = transform.GetChild(0).gameObject.GetComponent <EventCamera>();
 }