Ejemplo n.º 1
0
        protected override void DrawExtra()
        {
            base.DrawExtra();
            DrawModuleTitle("Image");
            Tooltip_Rec(SWTipsText.Right_ImageModule, new Rect(rightUpRect.x, GUILayoutUtility.GetLastRect().y, rightUpRect.width, GUILayoutUtility.GetLastRect().height));

            EffectDataColor _data = data.effectDataColor;

            UI_Color("Color", ref _data.color, ref _data.hdr, delegate(SWBaseInfo arg1, bool arg2) {
                SWUndo.Record(info.effector);
            }, true, true);
            Tooltip_Rec(SWTipsText.Right_Color, new Rect(rightUpRect.x, GUILayoutUtility.GetLastRect().y, rightUpRect.width, GUILayoutUtility.GetLastRect().height));


            GUILayout.BeginHorizontal();
            var temp = (SWOutputOP)UI_PopEnum("Blend Op", _data.op, true);

            if (_data.op != temp)
            {
                SWUndo.Record(info.effector);
                _data.op = temp;
            }
            GUILayout.EndHorizontal();
            Tooltip_Rec(SWTipsText.Right_BlendOp, new Rect(rightUpRect.x, GUILayoutUtility.GetLastRect().y, rightUpRect.width, GUILayoutUtility.GetLastRect().height));

            Tooltip_Rec(SWTipsText.Right_BlendFactor, new Rect(rightUpRect.x, GUILayoutUtility.GetLastRect().yMax, rightUpRect.width, GUILayoutUtility.GetLastRect().height));
            Factor_Pick(ref _data.param, true, "Blend Factor");
        }
Ejemplo n.º 2
0
        protected override void DrawNodeWindow(int id)
        {
            base.DrawNodeWindow(id);
            GUILayout.Space(7);
            GUILayout.BeginHorizontal();
            GUILayout.Space(7);
            GUILayout.BeginVertical();

            float labelWith = 42;

            EffectDataColor _data = data.effectDataColor;
            string          name  = _data.hdr ? "[HDR]" : "Color";

            GUILayout.BeginHorizontal();
            GUILayout.Label(name, SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
            var rect = GUILayoutUtility.GetLastRect();

            if (SWCommon.GetMouseDown(1))
            {
                if (rect.Contains(Event.current.mousePosition))
                {
                    data.effectDataColor.hdr = !data.effectDataColor.hdr;
                }
            }
            _data.color = EditorGUILayout.ColorField(new GUIContent(""), _data.color, true, true, _data.hdr, null, GUILayout.Width(128 - labelWith));
            GUILayout.EndHorizontal();


            GUILayout.Space(2);
            GUILayout.BeginHorizontal();
            GUILayout.Label("Op", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
            _data.op = (SWOutputOP)EditorGUILayout.EnumPopup(_data.op, GUILayout.Width(128 - labelWith));
            GUILayout.EndHorizontal();
            GUILayout.Space(2);
            SWWindowMain.Instance.Factor_Pick(ref _data.param, PickParamType.node, "Factor", null, 128);

            GUILayout.Space(2);
            GUILayout.BeginHorizontal();
            GUILayout.Label("Depth", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
            var dep = EditorGUILayout.IntField(data.depth, GUILayout.Width(128 - labelWith));

            if (dep != 0 && dep != data.depth)
            {
                SWUndo.Record(this);
                data.depth = dep;
            }
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            DrawNodeWindowEnd();
        }
Ejemplo n.º 3
0
        protected void OpBlend()
        {
            float labelWith = 42;

            if (nodeCode.data.GetCodeType() == SWDataType._Color)
            {
                EffectDataColor _data = nodeCode.data.effectDataColor;
                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label("Op", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
                _data.op = (SWOutputOP)EditorGUILayout.EnumPopup(_data.op, GUILayout.Width(128 - labelWith));
                GUILayout.EndHorizontal();
                GUILayout.Space(2);
                SWWindowMain.Instance.Factor_Pick(ref _data.param, PickParamType.node, "Factor", null, 128);

                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label("Depth", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
                var dep = EditorGUILayout.IntField(nodeCode.data.depth, GUILayout.Width(128 - labelWith));
                if (dep != 0 && dep != nodeCode.data.depth)
                {
                    SWUndo.Record(this);
                    nodeCode.data.depth = dep;
                }
                GUILayout.EndHorizontal();
            }
            else if (nodeCode.data.GetCodeType() == SWDataType._UV)
            {
                EffectDataUV dataUV = nodeCode.data.effectDataUV;
                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label("Op", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
                dataUV.op = (SWUVop)EditorGUILayout.EnumPopup(dataUV.op, GUILayout.Width(128 - labelWith));
                GUILayout.EndHorizontal();
                GUILayout.Space(2);
                SWWindowMain.Instance.Factor_Pick(ref dataUV.param, PickParamType.node, "Factor", null, 128);
            }
            else if (nodeCode.data.GetCodeType() == SWDataType._Alpha)
            {
                var data = nodeCode.data;
                GUILayout.BeginHorizontal();
                GUILayout.Label("Final", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(SWGlobalSettings.LabelWidthLong));
                data.effectData.pop_final = EditorGUILayout.Toggle(data.effectData.pop_final, GUILayout.Width(SWGlobalSettings.FieldWidth));
                GUILayout.EndHorizontal();
                Tooltip_Rec(SWTipsText.Right_AlphaFinal, new Rect(rightUpRect.x, GUILayoutUtility.GetLastRect().y, rightUpRect.width, GUILayoutUtility.GetLastRect().height));
            }
        }
        protected override void DrawNodeWindow(int id)
        {
            base.DrawNodeWindow(id);
            if (SWWindowMain.Instance.data.shaderType == SWShaderType.normal)
            {
                DrawNormal();
            }
            else if (SWWindowMain.Instance.data.shaderType == SWShaderType.sprite)
            {
                DrawSprite();
            }
            else if (SWWindowMain.Instance.data.shaderType == SWShaderType.ui)
            {
                DrawUIImage();
            }
            else if (SWWindowMain.Instance.data.shaderType == SWShaderType.uiFont)
            {
                DrawUIText();
            }


            float labelWith = 38;

            GUILayout.Space(nodeHeight - 42);


            EffectDataColor _data = data.effectDataColor;
            string          name  = _data.hdr ? "[HDR]" : "Color";

            GUILayout.BeginHorizontal();
            GUILayout.Label(name, SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
            var rect = GUILayoutUtility.GetLastRect();

            if (SWCommon.GetMouseDown(1))
            {
                if (rect.Contains(Event.current.mousePosition))
                {
                    data.effectDataColor.hdr = !data.effectDataColor.hdr;
                }
            }
            _data.color = EditorGUILayout.ColorField(new GUIContent(""), _data.color, false, true, _data.hdr, null, GUILayout.Width(nodeWidth - 15 - labelWith));
            GUILayout.EndHorizontal();


            DrawNodeWindowEnd();
        }
Ejemplo n.º 5
0
        protected override void DrawNodeWindow(int id)
        {
            base.DrawNodeWindow(id);
            GUILayout.Space(7);
            GUILayout.BeginHorizontal();
            GUILayout.Space(7);
            GUILayout.BeginVertical();

            float labelWith = 42;

            EffectDataColor _data = data.effectDataColor;
            string          name  = _data.hdr ? "[HDR]" : "Color";

            GUILayout.BeginHorizontal();
            GUILayout.Label(name, SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
            SWCommon.HRDColor_Switch(window, ref data.effectDataColor.hdr);
            SWCommon.HRDColor_Field(_data.color, true, _data.hdr, 128 - labelWith, delegate(Color c) {
                _data.color = c;
                SWProperties.SetColor(data, _data.color);
            }
                                    );
            GUILayout.EndHorizontal();


            GUILayout.Space(2);
            ePopup_op.Show(128 - labelWith, "Op", labelWith);
            GUILayout.Space(2);
            SWWindowMain.Instance.Factor_Pick(ref _data.param, PickParamType.node, "Factor", null, 128);

            GUILayout.Space(2);
            GUILayout.BeginHorizontal();
            GUILayout.Label("Depth", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
            var dep = EditorGUILayout.IntField(data.depth, GUILayout.Width(128 - labelWith));

            if (dep != 0 && dep != data.depth)
            {
                SWUndo.Record(this);
                data.depth = dep;
            }
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            DrawNodeWindowEnd();
        }
Ejemplo n.º 6
0
        protected override void DrawNodeWindow(int id)
        {
            base.DrawNodeWindow(id);
            if (SWWindowMain.Instance.data.shaderType == SWShaderType.normal)
            {
                DrawNormal();
            }
            else if (SWWindowMain.Instance.data.shaderType == SWShaderType.sprite)
            {
                DrawSprite();
            }
            else if (SWWindowMain.Instance.data.shaderType == SWShaderType.ui)
            {
                DrawUIImage();
            }
            else if (SWWindowMain.Instance.data.shaderType == SWShaderType.uiFont)
            {
                DrawUIText();
            }
            else if (SWWindowMain.Instance.data.shaderType == SWShaderType.ngui_ui2dSprite)
            {
                DrawUIImage();
            }

            float labelWith = 38;

            GUILayout.Space(nodeHeight - 42);


            EffectDataColor _data = data.effectDataColor;
            string          name  = _data.hdr ? "[HDR]" : "Color";

            GUILayout.BeginHorizontal();
            GUILayout.Label(name, SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
            SWCommon.HRDColor_Switch(window, ref data.effectDataColor.hdr);
            SWCommon.HRDColor_Field(_data.color, false, _data.hdr, nodeWidth - 15 - labelWith, delegate(Color c) {
                _data.color = c;
                SWProperties.SetColor(data, _data.color);
            }
                                    );
            GUILayout.EndHorizontal();


            DrawNodeWindowEnd();
        }
Ejemplo n.º 7
0
        protected void OpBlend()
        {
            float labelWith = 42;

            if (nodeCode.data.GetCodeType() == SWDataType._Color)
            {
                EffectDataColor _data = nodeCode.data.effectDataColor;
                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label("Op", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
                _data.op = (SWOutputOP)EditorGUILayout.EnumPopup(_data.op, GUILayout.Width(128 - labelWith));
                GUILayout.EndHorizontal();
                GUILayout.Space(2);
                SWWindowMain.Instance.Factor_Pick(ref _data.param, PickParamType.node, "Factor", null, 128);

                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label("Depth", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
                var dep = EditorGUILayout.IntField(nodeCode.data.depth, GUILayout.Width(128 - labelWith));
                if (dep != 0 && dep != nodeCode.data.depth)
                {
                    SWUndo.Record(this);
                    nodeCode.data.depth = dep;
                }
                GUILayout.EndHorizontal();
            }
            else if (nodeCode.data.GetCodeType() == SWDataType._UV)
            {
                EffectDataUV dataUV = nodeCode.data.effectDataUV;
                GUILayout.Space(2);
                GUILayout.BeginHorizontal();
                GUILayout.Label("Op", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(labelWith));
                dataUV.op = (SWUVop)EditorGUILayout.EnumPopup(dataUV.op, GUILayout.Width(128 - labelWith));
                GUILayout.EndHorizontal();
                GUILayout.Space(2);
                SWWindowMain.Instance.Factor_Pick(ref dataUV.param, PickParamType.node, "Factor", null, 128);
            }
            else if (nodeCode.data.GetCodeType() == SWDataType._Alpha)
            {
            }
        }