Exemplo n.º 1
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();
        }
Exemplo 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));
            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();
        }
Exemplo n.º 3
0
        protected void UI_Color(string name, ref Color v, ref bool hdr, System.Action <SWBaseInfo, bool> act = null, bool before = false, bool isRightUp = false)
        {
            if (isRightUp)
            {
                GUILayout.BeginHorizontal();
            }
            Color temp;


            if (hdr)
            {
                name += " [HDR]";
            }
            GUILayout.Label(name, SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(SWGlobalSettings.LabelWidthLong));
            SWCommon.HRDColor_Switch(this, ref hdr);
            var vvv = v;

            SWCommon.HRDColor_Field(v, true, hdr, SWGlobalSettings.FieldWidth, delegate(Color c) {
                if (before)
                {
                    if (act != null)
                    {
                        act(info, true);
                    }
                }
                vvv = c;
                if (!before)
                {
                    if (act != null)
                    {
                        act(info, true);
                    }
                }
                SWProperties.SetColor(data, vvv);
            }
                                    );
            v = vvv;
            if (isRightUp)
            {
                GUILayout.EndHorizontal();
            }
        }