コード例 #1
0
		//METHODS:
#if UNITY_EDITOR
		public override void Draw(E.SceneView sceneView)
		{
			base.Draw(sceneView);
			EditorUtil.BeginColorPocket(m_color);
			G.Label(GetPositionedRect(sceneView), m_text, guiStyle);
			EditorUtil.EndColorPocket();
		}
コード例 #2
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void ToggleButton(Rect position, Setting <bool> val, string label)
 {
     UGUI.Label(position, label, Style.Label);
     if (UGUI.Button(position, val.Value ? LabelEnabled : LabelDisabled, Style.TextButton))
     {
         val.Value = !val.Value;
     }
 }
コード例 #3
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void LabelCenter(SmartRect position, string content, bool move = false)
 {
     UGUI.Label(position.ToRect(), content, Style.LabelCenter);
     if (move)
     {
         position.MoveY();
     }
 }
コード例 #4
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static bool ToggleButton(Rect position, bool val, string label)
 {
     UGUI.Label(position, label, Style.Label);
     if (UGUI.Button(position, val ? LabelEnabled : LabelDisabled, Style.TextButton))
     {
         return(!val);
     }
     return(val);
 }
コード例 #5
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static string TextField(Rect position, string value, string label, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     return(UGUI.TextField(position, value, Style.TextField));
 }
コード例 #6
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void TextField(Rect position, Setting <string> value, string label, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     value.Value = UGUI.TextField(position, value.Value, Style.TextField);
 }
コード例 #7
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void HorizontalSlider(Rect position, Setting <float> value, string label, float min, float max, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     value.Value = UGUI.HorizontalSlider(position, value.Value, min, max, Style.Slider, Style.SliderBody);
 }
コード例 #8
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static float HorizontalSlider(Rect position, float value, string label, float min, float max, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     return(UGUI.HorizontalSlider(position, value, min, max, Style.Slider, Style.SliderBody));
 }
コード例 #9
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void Toggle(SmartRect position, Setting <bool> val, string label, float offset, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     position.MoveOffsetX(position.width - Style.Height);
     val.Value = UGUI.Toggle(position.ToRect(), val.Value, string.Empty, Style.Toggle);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
 }
コード例 #10
0
ファイル: GUI.cs プロジェクト: Lineyka/Anarchy
 public static bool Toggle(SmartRect position, bool val, string label, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     position.MoveOffsetX(position.width - Height);
     val = UGUI.Toggle(position.ToRect(), val, string.Empty, Style.Toggle);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
     return(val);
 }
コード例 #11
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void ToggleButton(SmartRect position, Setting <bool> val, string label, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     if (UGUI.Button(position.ToRect(), val.Value ? LabelEnabled : LabelDisabled, Style.TextButton))
     {
         val.Value = !val.Value;
     }
     if (move)
     {
         position.MoveY();
     }
 }
コード例 #12
0
ファイル: GUI.cs プロジェクト: Lineyka/Anarchy
 public static bool ToggleButton(SmartRect position, bool val, string label, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     if (UGUI.Button(position.ToRect(), val ? LabelEnabled : LabelDisabled, Style.TextButton))
     {
         val = !val;
     }
     if (move)
     {
         position.MoveY();
     }
     return(val);
 }
コード例 #13
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void HorizontalSlider(SmartRect position, Setting <float> value, string label, float min, float max, float offset, bool move = false)
 {
     if (offset > 0f)
     {
         UGUI.Label(position.ToRect(), label, Style.Label);
         position.MoveOffsetX(offset);
     }
     value.Value = UGUI.HorizontalSlider(position.ToRect(), value.Value, min, max, Style.Slider, Style.SliderBody);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
 }
コード例 #14
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void TextField(SmartRect position, Setting <string> value, string label, float offset, bool move = false)
 {
     if (offset > 0f)
     {
         UGUI.Label(position.ToRect(), label, Style.Label);
         position.MoveOffsetX(offset);
     }
     value.Value = UGUI.TextField(position.ToRect(), value.Value, Style.TextField);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
 }
コード例 #15
0
        private void WindowFunc(int windowID)
        {
            const int border  = 10;
            const int width   = 50;
            const int height  = 25;
            const int spacing = 10;

            Rect l = new Rect(
                border, border + spacing,
                this.windowRect.width - border * 2, this.windowRect.height - border * 2 - height - spacing
                );

            if (this.text_style is null)
            {
                UGUI.Label(l, this.msg);
            }
            else
            {
                UGUI.Label(l, this.msg, this.text_style);
            }

            Rect b = new Rect(
                this.windowRect.width - width - border,
                this.windowRect.height - height - border,
                width,
                height);

            if (this.action is null)
            {
                if (UGUI.Button(b, "OK"))
                {
                    Destroy(this.gameObject);
                }
            }
            else
            {
                if (UGUI.Button(b, "OK"))
                {
                    this.action(); Destroy(this.gameObject);
                }

                Rect b1 = new Rect(b);
                b1.x -= b.width + spacing;
                if (UGUI.Button(b1, "Cancel"))
                {
                    Destroy(this.gameObject);
                }
            }
        }
コード例 #16
0
ファイル: GUI.cs プロジェクト: Lineyka/Anarchy
 public static float HorizontalSlider(SmartRect position, float value, string label, float offset, bool move = false)
 {
     if (offset > 0f)
     {
         UGUI.Label(position.ToRect(), label, Style.Label);
         position.MoveOffsetX(offset);
     }
     value = UGUI.HorizontalSlider(position.ToRect(), value, 0f, 1f, Style.Slider, Style.SliderBody);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
     return(value);
 }
コード例 #17
0
ファイル: GUI.cs プロジェクト: Lineyka/Anarchy
        public static void TextField(Rect position, Setting <int> val, string label, float offset)
        {
            if (offset > 0f)
            {
                UGUI.Label(position, label, Style.Label);
                position.x     += offset;
                position.width -= offset;
            }
            if (!integers.ContainsKey(val))
            {
                integers.Add(val, val.Value.ToString());
            }
            string text = integers[val];

            text = UGUI.TextField(position, text, Style.TextField);
            int.TryParse(text, out val.Value);
            integers[val] = text;
        }
コード例 #18
0
        private void WindowFunc(int windowID)
        {
            const int border  = 10;
            const int width   = 50;
            const int height  = 25;
            const int spacing = 10;

            Rect l = new Rect(
                border, border + spacing,
                this.windowRect.width - border * 2, this.windowRect.height - border * 2 - height - spacing
                );

            if (this.text_style is null)
            {
                UGUI.Label(l, this.msg);
            }
            else
            {
                UGUI.Label(l, this.msg, this.text_style);
            }

            Rect b = new Rect(
                this.windowRect.width - width - border,
                this.windowRect.height - height - border,
                width,
                height);

            if ((0 == Event.current.button) && (EventType.MouseUp == Event.current.type))
            {
                this.isTicking = false;
            }

            string label = this.isTicking ? string.Format("{0}", (int)(this.seconds_to_show - this.timer)) : "OK";

            if (UGUI.Button(b, label))
            {
                Destroy(this.gameObject);
            }

            GUI.DragWindow();
        }
コード例 #19
0
ファイル: GUI.cs プロジェクト: Lineyka/Anarchy
        public static void TextField(SmartRect position, Setting <int> val, string label, float offset, bool move = false)
        {
            if (offset > 0f)
            {
                UGUI.Label(position.ToRect(), label, Style.Label);
                position.MoveOffsetX(offset);
            }
            if (!integers.ContainsKey(val))
            {
                integers.Add(val, val.Value.ToString());
            }
            string text = integers[val];

            text = UGUI.TextField(position.ToRect(), text, Style.TextField);
            int.TryParse(text, out val.Value);
            integers[val] = text;
            position.ResetX();
            if (move)
            {
                position.MoveY();
            }
        }
コード例 #20
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void LabelCenter(Rect position, string content)
 {
     UGUI.Label(position, content, Style.LabelCenter);
 }
コード例 #21
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void Toggle(Rect position, Setting <bool> val, string label)
 {
     UGUI.Label(position, label, Style.Label);
     val.Value = UGUI.Toggle(new Rect(position.x + position.width - Style.Height, position.y, Style.Height, Style.Height), val.Value, string.Empty, Style.Toggle);
 }
コード例 #22
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static bool Toggle(Rect position, bool val, string label)
 {
     UGUI.Label(position, label, Style.Label);
     return(UGUI.Toggle(new Rect(position.x + position.width - Style.Height, position.y, Style.Height, Style.Height), val, string.Empty, Style.Toggle));
 }