public void EndEditUIScale()
        {
            float scale = 1.0f;

            if (UIAutoScale)
            {
                if (!Application.isEditor)
                {
                    scale = Mathf.Clamp((float)System.Math.Round(Display.main.systemWidth / 1920.0f, 1), 0.5f, 4);
                }
            }
            else
            {
                scale = UIScale;
            }

            IRTEAppearance appearance = IOC.Resolve <IRTEAppearance>();

            appearance.UIScale = scale;

            IRuntimeHandlesComponent handles = IOC.Resolve <IRuntimeHandlesComponent>();

            handles.HandleScale     = scale;
            handles.SceneGizmoScale = scale;
        }
예제 #2
0
        protected override void OnEditorExist()
        {
            IRTEAppearance appearance = IOC.Resolve <IRTEAppearance>();

            appearance.UIScale = Scale;

            IRuntimeHandlesComponent handles = IOC.Resolve <IRuntimeHandlesComponent>();

            handles.HandleScale     = Scale;
            handles.SceneGizmoScale = Scale;
        }
        private void ApplyGridOpacity(float value)
        {
            IRuntimeHandlesComponent handlesComponent = IOC.Resolve <IRuntimeHandlesComponent>();
            Color gridColor = handlesComponent.Colors.GridColor;

            gridColor.a = value;
            handlesComponent.Colors.GridColor = gridColor;
            foreach (IRuntimeSceneComponent sceneComponent in m_sceneComponents.Values)
            {
                sceneComponent.GridZTest = !sceneComponent.GridZTest;
                sceneComponent.GridZTest = !sceneComponent.GridZTest;
            }
        }
예제 #4
0
        protected virtual void AwakeOverride()
        {
            m_rte = RTE;
            IOC.Register <IRTE>(m_rte);
            IOC.Register(m_rte);

            m_resourcePreview         = ResourcePreview;
            m_rteAppearance           = RTEAppearance;
            m_windowManager           = WindowManager;
            m_console                 = RuntimeConsole;
            m_gameObjectCmd           = GameObjectCmd;
            m_editCmd                 = EditCmd;
            m_contextMenu             = ContextMenu;
            m_runtimeHandlesComponent = RuntimeHandlesComponent;
            m_editorsMap              = EditorsMap;
        }
예제 #5
0
        private void OnDestroy()
        {
            if (m_instance == this)
            {
                m_instance = null;
            }

            OnDestroyOverride();

            IOC.Unregister <IRTE>(m_rte);
            IOC.Unregister(m_rte);

            m_resourcePreview         = null;
            m_rteAppearance           = null;
            m_windowManager           = null;
            m_console                 = null;
            m_gameObjectCmd           = null;
            m_editCmd                 = null;
            m_contextMenu             = null;
            m_runtimeHandlesComponent = null;
            m_editorsMap              = null;
        }