UnityEditor.CameraControllerStandard.Update C# (CSharp) Method

Update() public method

public Update ( CameraState cameraState, Camera cam ) : void
cameraState CameraState
cam UnityEngine.Camera
return void
        public override void Update(CameraState cameraState, Camera cam)
        {
            Event current = Event.current;
            if (current.type == EventType.MouseUp)
            {
                this.m_CurrentViewTool = ViewTool.None;
            }
            if (current.type == EventType.MouseDown)
            {
                int button = current.button;
                bool flag = current.control && (Application.platform == RuntimePlatform.OSXEditor);
                if (button == 2)
                {
                    this.m_CurrentViewTool = ViewTool.Pan;
                }
                else if (((button <= 0) && flag) || ((button == 1) && current.alt))
                {
                    this.m_CurrentViewTool = ViewTool.Zoom;
                    this.m_StartZoom = cameraState.viewSize.value;
                    this.m_ZoomSpeed = Mathf.Max(Mathf.Abs(this.m_StartZoom), 0.3f);
                    this.m_TotalMotion = 0f;
                }
                else if (button <= 0)
                {
                    this.m_CurrentViewTool = ViewTool.Orbit;
                }
                else if ((button == 1) && !current.alt)
                {
                    this.m_CurrentViewTool = ViewTool.FPS;
                }
            }
            switch (current.type)
            {
                case EventType.MouseUp:
                    this.HandleCameraMouseUp();
                    break;

                case EventType.MouseDrag:
                    this.HandleCameraMouseDrag(cameraState, cam);
                    break;

                case EventType.KeyDown:
                    this.HandleCameraKeyDown();
                    break;

                case EventType.KeyUp:
                    this.HandleCameraKeyUp();
                    break;

                case EventType.ScrollWheel:
                    this.HandleCameraScrollWheel(cameraState);
                    break;

                case EventType.Layout:
                {
                    Vector3 movementDirection = this.GetMovementDirection();
                    if (movementDirection.sqrMagnitude != 0f)
                    {
                        cameraState.pivot.value += cameraState.rotation.value * movementDirection;
                    }
                    break;
                }
            }
        }