addNormal() public method

public addNormal ( double d ) : void
d double
return void
Esempio n. 1
0
        private void drawNormalControls(Color contentColor)
        {
            Color oldContentColor    = GUI.contentColor;
            Color oldBackgroundColor = GUI.backgroundColor;

            // Normal controls
            GUILayout.BeginHorizontal();
            GUI.contentColor = NORMAL_COLOR;
            GUILayout.Label("Normal:", GUILayout.Width(100));
            if (!curState.normalParsed)
            {
                GUI.contentColor    = Color.red;
                GUI.backgroundColor = Color.red;
            }
            string check = GUILayout.TextField(curState.normalText, GUILayout.Width(70));

            GUI.contentColor    = oldContentColor;
            GUI.backgroundColor = oldBackgroundColor;
            if (!curState.normalText.Equals(check, StringComparison.Ordinal))
            {
                curState.setNormal(check);
            }
            GUI.contentColor = contentColor;
            GUIParts.drawPlusMinusButtons(() => {
                curState.addNormal(options.increment);
            }, () => {
                curState.addNormal(-options.increment);
            });
            GUILayout.EndHorizontal();
        }
Esempio n. 2
0
        // debugging function
        private void drawNormalControls(Color contentColor)
        {
            // Normal controls
            GUILayout.BeginHorizontal();
            GUILayout.Label("Normal:", GUILayout.Width(100));
            if (!curState.normalParsed)
            {
                GUI.contentColor = Color.red;
            }
            string check = GUILayout.TextField(curState.normalText, GUILayout.Width(100));

            if (!curState.normalText.Equals(check, StringComparison.Ordinal))
            {
                curState.setNormal(check);
            }
            GUI.contentColor = contentColor;
            GUIParts.drawButton("-", Color.red, delegate() { curState.addNormal(options.increment * -1.0); });
            GUIParts.drawButton("+", Color.green, delegate() { curState.addNormal(options.increment); });
            GUILayout.EndHorizontal();
        }