Пример #1
0
        public void AdjustCamCursor(BasicSettings.Sides caveSide)
        {
            if(_wandCaveIntersection != caveSide)
            {
                _wandCaveIntersection = caveSide;

                //Debug.Log("AdjustCamCursor, new side: " + caveSide);

                // Deactivate all Cursor Cams
                foreach (var fvi in FullViewInfo)
                {
                    fvi.Value.Left.CamCursor.enabled = false;
                    fvi.Value.Right.CamCursor.enabled = false;
                }

                // Get Cam
                var camCursorLeft = FullViewInfo.FirstOrDefault(x => x.Value.CAVESide.Name == caveSide).Value.Left.CamCursor;
                var camCursorRight = FullViewInfo.FirstOrDefault(x => x.Value.CAVESide.Name == caveSide).Value.Right.CamCursor;

                if (camCursorLeft != null && API.Instance.Cave.CaveSettings.GUILocation != caveSide)
                {
                    camCursorLeft.enabled = camCursorRight.enabled = true;
                }

                // Adjust MouseCanvas
                AdjustMouseCursorCanvas(caveSide);
            }
        }
Пример #2
0
        private void AdjustMouseCursorCanvas(BasicSettings.Sides side)
        {
            Transform caveSide;
            Vector2 rot = Vector2.zero;

            switch (side)
            {
                case BasicSettings.Sides.Left:
                    caveSide = API.Instance.Cave.CAVELeftXXL;
                    rot.x = 0f;
                    rot.y = 270f;
                    break;

                case BasicSettings.Sides.Right:
                    caveSide = API.Instance.Cave.CAVERightXXL;
                    rot.x = 0f;
                    rot.y = 90;
                    break;

                case BasicSettings.Sides.Bottom:
                    caveSide = API.Instance.Cave.CAVEBottomXXL;
                    rot.x = 90f;
                    rot.y = 0f;
                    break;

                default:
                    caveSide = API.Instance.Cave.CAVEFrontXXL;
                    break;
            }

            _canvasMouseCursorDuplicate.renderMode = RenderMode.ScreenSpaceOverlay; // To avoid bug
            _canvasMouseCursorDuplicate.renderMode = RenderMode.WorldSpace;
            _canvasMouseCursorDuplicateRectTransform.sizeDelta = new Vector2(caveSide.transform.localScale.z * 1000f, caveSide.transform.localScale.x * 1000f);
            _canvasMouseCursorDuplicateRectTransform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
            _canvasMouseCursorDuplicateRectTransform.SetParent(API.Instance.Cave.transform);
            _canvasMouseCursorDuplicateRectTransform.localPosition = caveSide.transform.localPosition;
            _canvasMouseCursorDuplicateRectTransform.eulerAngles = new Vector3(rot.x, rot.y, 0f);
        }
Пример #3
0
        private void ConfigureCamCursor(Camera camCursor, Camera cam, BasicSettings.Sides caveSide, bool isEyeLeft = true)
        {
            camCursor.CopyFrom(cam);
            camCursor.cullingMask = LayerMask.GetMask("UI");

            camCursor.name = "CameraCursor" + caveSide.ToString() + (isEyeLeft ? "Left" : "Right");
            camCursor.clearFlags = CameraClearFlags.Depth;
            camCursor.transform.SetParent(cam.transform.parent);
            camCursor.depth = (int)CameraDepths.Cursor;
            camCursor.enabled = false;
            camCursor.orthographic = true;
            camCursor.farClipPlane = 10f;
            camCursor.nearClipPlane = 5f;
        }
Пример #4
0
        public override void OnEnable()
        {
            // Tonemapping settings
            m_Tonemapping = new TonemappingSettings
            {
                tonemapper = FindSetting((Settings x) => x.tonemapping.tonemapper),
                neutralBlackIn = FindSetting((Settings x) => x.tonemapping.neutralBlackIn),
                neutralWhiteIn = FindSetting((Settings x) => x.tonemapping.neutralWhiteIn),
                neutralBlackOut = FindSetting((Settings x) => x.tonemapping.neutralBlackOut),
                neutralWhiteOut = FindSetting((Settings x) => x.tonemapping.neutralWhiteOut),
                neutralWhiteLevel = FindSetting((Settings x) => x.tonemapping.neutralWhiteLevel),
                neutralWhiteClip = FindSetting((Settings x) => x.tonemapping.neutralWhiteClip)
            };

            // Basic settings
            m_Basic = new BasicSettings
            {
                exposure = FindSetting((Settings x) => x.basic.postExposure),
                temperature = FindSetting((Settings x) => x.basic.temperature),
                tint = FindSetting((Settings x) => x.basic.tint),
                hueShift = FindSetting((Settings x) => x.basic.hueShift),
                saturation = FindSetting((Settings x) => x.basic.saturation),
                contrast = FindSetting((Settings x) => x.basic.contrast)
            };

            // Channel mixer
            m_ChannelMixer = new ChannelMixerSettings
            {
                channels = new[]
                {
                    FindSetting((Settings x) => x.channelMixer.red),
                    FindSetting((Settings x) => x.channelMixer.green),
                    FindSetting((Settings x) => x.channelMixer.blue)
                },
                currentEditingChannel = FindSetting((Settings x) => x.channelMixer.currentEditingChannel)
            };

            // Color wheels
            m_ColorWheels = new ColorWheelsSettings
            {
				mode = FindSetting((Settings x) => x.colorWheels.mode),
                log = FindSetting((Settings x) => x.colorWheels.log),
                linear = FindSetting((Settings x) => x.colorWheels.linear)
            };

            // Curves
            m_Curves = new CurvesSettings
            {
                master = FindSetting((Settings x) => x.curves.master.curve),
                red = FindSetting((Settings x) => x.curves.red.curve),
                green = FindSetting((Settings x) => x.curves.green.curve),
                blue = FindSetting((Settings x) => x.curves.blue.curve),

                hueVShue = FindSetting((Settings x) => x.curves.hueVShue.curve),
                hueVSsat = FindSetting((Settings x) => x.curves.hueVSsat.curve),
                satVSsat = FindSetting((Settings x) => x.curves.satVSsat.curve),
                lumVSsat = FindSetting((Settings x) => x.curves.lumVSsat.curve),

                currentEditingCurve = FindSetting((Settings x) => x.curves.e_CurrentEditingCurve),
                curveY = FindSetting((Settings x) => x.curves.e_CurveY),
                curveR = FindSetting((Settings x) => x.curves.e_CurveR),
                curveG = FindSetting((Settings x) => x.curves.e_CurveG),
                curveB = FindSetting((Settings x) => x.curves.e_CurveB)
            };

            // Prepare the curve editor and extract curve display settings
            m_CurveDict = new Dictionary<SerializedProperty, Color>();

            var settings = CurveEditor.Settings.defaultSettings;

            m_CurveEditor = new CurveEditor(settings);
            AddCurve(m_Curves.master,   new Color(1f, 1f, 1f), 2, false);
            AddCurve(m_Curves.red,      new Color(1f, 0f, 0f), 2, false);
            AddCurve(m_Curves.green,    new Color(0f, 1f, 0f), 2, false);
            AddCurve(m_Curves.blue,     new Color(0f, 0.5f, 1f), 2, false);
            AddCurve(m_Curves.hueVShue, new Color(1f, 1f, 1f), 0, true);
            AddCurve(m_Curves.hueVSsat, new Color(1f, 1f, 1f), 0, true);
            AddCurve(m_Curves.satVSsat, new Color(1f, 1f, 1f), 0, false);
            AddCurve(m_Curves.lumVSsat, new Color(1f, 1f, 1f), 0, false);
        }