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"); }
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; } } }
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(); }
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); }
// Start is called before the first frame update void Start() { FirstPerson = GetComponent <UnityStandardAssets.Characters.FirstPerson.FirstPersonController>(); cameraobject = transform.GetChild(0).gameObject.GetComponent <EventCamera>(); }