Esempio n. 1
0
        /*-------------------------------输入---------------------------------------------------*/


        public static void ButtonText(string buttonName, string text, int jianGe, ref bool isShow, Action action, Action action2 = null)
        {
            bool tmp = isShow;

            MyCreate.Box(() =>
            {
                MyCreate.Heng(() =>
                {
                    MyCreate.Button(buttonName, jianGe - 10, () =>
                    {
                        tmp = !tmp;
                    });
                    MyCreate.AddSpace(10);
                    MyCreate.Shu(() =>
                    {
                        MyCreate.AddSpace(6);
                        MyCreate.TextButton(text, () =>
                        {
                            tmp = !tmp;
                        });
                    });
                });
                if (tmp && null != action)
                {
                    action();
                }
                if (null != action2)
                {
                    action2();
                }
            });
            isShow = tmp;
        }
Esempio n. 2
0
        /*-------------------------------Button---------------------------------------------------*/


        #region 私有 箭头
        private static void JianTuoText(string text, int width,
                                        ref bool isShow, MyEnumColor color, Action showAction, Action action, bool isNeedSpace = true)
        {
            bool tmp = isShow;

            MyCreate.Heng(() =>
            {
                string jianTuo = tmp ? "▼ ".AddSize(10).ToString(): "▶ ".AddSize(10).ToString();
                jianTuo       += text;
                string des     = jianTuo.AddColor(color, false);
                MyCreate.Heng(() =>
                {
                    MyCreate.ButtonLabel(des, width, () =>
                    {
                        tmp = !tmp;
                    });
                    if (null != action)
                    {
                        action();
                        if (isNeedSpace)
                        {
                            MyCreate.AddSpace();
                        }
                    }
                });
            });
            if (tmp && null != showAction)
            {
                showAction();
            }
            isShow = tmp;
        }
Esempio n. 3
0
 public static void TextButton(string str1, string buttonText, int jianGe, Action onClick)
 {
     MyCreate.Heng(() =>
     {
         MyCreate.Text("   " + str1, jianGe);
         MyCreate.Button(buttonText, onClick);
     });
 }
Esempio n. 4
0
 public static void TextSelectText(string str1, string str2, int jianGe)
 {
     MyCreate.Heng(() =>
     {
         MyCreate.Text("   " + str1, jianGe);
         MyCreate.SelectText(str2);
     });
 }
Esempio n. 5
0
        public static bool TextBool(string trueStirng, string falseString, bool value, int jianGe)
        {
            bool tmp = value;

            MyCreate.Heng(() =>
            {
                MyCreate.Text(tmp ? trueStirng : falseString, jianGe);
                tmp = MyCreate.InputBool(tmp);
            });
            return(tmp);
        }
Esempio n. 6
0
        public static int TextInt(string str1, int value, int minValue, int maxValue, int jianGe)
        {
            int tmp = value;

            MyCreate.Heng(() =>
            {
                MyCreate.Text("   " + str1, jianGe);
                tmp = MyCreate.InputInt(minValue, maxValue, value);
            });
            return(tmp);
        }
Esempio n. 7
0
        public static float TextFloat(string str1, float value, float minValue, float maxValue, int jianGe)
        {
            float tmp = value;

            MyCreate.Heng(() =>
            {
                MyCreate.Text("   " + str1, jianGe);
                tmp = MyCreate.InputFloat(minValue, maxValue, value);
            });
            return(tmp);
        }
Esempio n. 8
0
        /*-------------------------------Text---------------------------------------------------*/

        public static Vector3 TextVector3(string str1, Vector3 position, int jianGe)
        {
            Vector3 tmp = position;

            MyCreate.Heng(() =>
            {
                MyCreate.Text("   " + str1, jianGe);
                tmp = MyCreate.InputVector3(tmp);
            });
            return(tmp);
        }
Esempio n. 9
0
        public static bool TextBool(string str1, bool value, int jianGe)
        {
            bool tmp = value;

            MyCreate.Heng(() =>
            {
                MyCreate.Text("   " + str1, jianGe);
                tmp = MyCreate.InputBool(tmp);
            });
            return(tmp);
        }
Esempio n. 10
0
        public static Enum TextEnum(string str1, Enum myEnum, int jianGe, bool isNeedKongGe)
        {
            Enum   tmp = myEnum;
            string des = isNeedKongGe ? "   " + str1 : str1;

            MyCreate.Heng(() =>
            {
                MyCreate.Text(des, jianGe);
                tmp = MyCreate.Enum(tmp);
            });
            return(tmp);
        }
Esempio n. 11
0
        public static int TextEnum(string str1, int value, string[] displayedOptions, int jianGe, bool isNeedKongGe)
        {
            int    tmp = value;
            string des = isNeedKongGe ? "   " + str1 : str1;

            MyCreate.Heng(() =>
            {
                MyCreate.Text(des, jianGe);
                tmp = MyCreate.Enum(tmp, displayedOptions);
            });
            return(tmp);
        }
Esempio n. 12
0
 public static void TextEnabledString(string str1, string inputStr, int jianGe)
 {
     MyCreate.Heng(() =>
     {
         MyCreate.Text("   " + str1, jianGe);
         MyCreate.Shu(() =>
         {
             MyCreate.AddSpace(5);
             GUI.enabled = false;
             MyCreate.InputString(inputStr);
             GUI.enabled = true;
         });
     });
 }
Esempio n. 13
0
 public static void TextText(string str1, string str2, int jianGe, bool isKongGe = true)
 {
     MyCreate.Heng(() =>
     {
         if (isKongGe)
         {
             MyCreate.Text("   " + str1, jianGe);
         }
         else
         {
             MyCreate.Text(str1, jianGe);
         }
         MyCreate.Text(str2);
     });
 }
Esempio n. 14
0
        public static string TextString(string str1, string inputStr, int jianGe, Action action, bool isNeedRed = false)
        {
            string des = str1;
            string tmp = inputStr;

            if (isNeedRed && string.IsNullOrEmpty(tmp))
            {
                des = des.AddRed();
            }
            MyCreate.Heng(() =>
            {
                MyCreate.ButtonLabel("   " + des, jianGe, action);
                tmp = MyCreate.InputString(tmp);
            });
            return(tmp);
        }
Esempio n. 15
0
        public static string StringButton(string value, int jianGe, string buutonName, Action action)
        {
            string tmp = value;

            MyCreate.Heng(() =>
            {
                MyCreate.Shu(() =>
                {
                    MyCreate.AddSpace(4);
                    tmp = MyCreate.InputString(tmp, jianGe);
                });
                if (!string.IsNullOrEmpty(tmp))
                {
                    MyCreate.Button("   " + buutonName + "   ", action);
                }
                MyCreate.AddSpace();
            });
            return(tmp);
        }
Esempio n. 16
0
        public static string TextString(string str1, string inputStr, int jianGe, bool isNeedRed = false)
        {
            string des = str1;
            string tmp = inputStr;

            if (isNeedRed && string.IsNullOrEmpty(tmp))
            {
                des = des.AddRed();
            }
            MyCreate.Heng(() =>
            {
                MyCreate.Text("   " + des, jianGe);
                MyCreate.Shu(() =>
                {
                    MyCreate.AddSpace(5);
                    tmp = MyCreate.InputString(tmp);
                });
            });
            return(tmp);
        }
Esempio n. 17
0
        public static void Text3(string str1, string str2, string str3, int jianGe, ref bool isShow, Action showAction, MyEnumColor color)
        {
            bool tmp = isShow;

            MyCreate.Heng(() =>
            {
                string des = (tmp ? "▼ ".AddSize(10) + str1 : "▶ ".AddSize(10) + str1).AddColor(color, false);
                MyCreate.ButtonLabel(des, jianGe, () =>
                {
                    tmp = !tmp;
                });
                MyCreate.Text(str2);
                MyCreate.AddSpace();
                MyCreate.Text(str3);
            });
            if (tmp && null != showAction)
            {
                showAction();
            }
            isShow = tmp;
        }
Esempio n. 18
0
        public static void SelectTextText2(string str1, string str2, int jianGe, ref bool isShow, Action showAction, MyEnumColor color)
        {
            bool   tmp = isShow;
            string des = isShow ? "▼ ".AddColorAndSize(color, 10, false) + str2 : "▶ ".AddColorAndSize(color, 10, false) + str2;

            MyCreate.Heng(() =>
            {
                MyCreate.SelectText(str1, jianGe - 13);
                MyCreate.Heng(() =>
                {
                    MyCreate.ButtonLabel(des, 0, () =>
                    {
                        tmp = !tmp;
                    });
                });
            });
            if (tmp && null != showAction)
            {
                showAction();
            }
            isShow = tmp;
        }
Esempio n. 19
0
        private static void JianTuoText2(string text, int width,
                                         ref bool isShow, Action showAction, Action action, bool isNeedSpace = true, MyEnumColor color = MyEnumColor.LightBlue)
        {
            bool   tmp = isShow;
            string des = isShow ? "▼".AddColorAndSize(color, 10, false) : "▶".AddColorAndSize(color, 10, false);

            MyCreate.Heng(() =>
            {
                MyCreate.ButtonLabel(text, width, () =>
                {
                    tmp = !tmp;
                });
                MyCreate.AddSpace();
                MyCreate.Heng(() =>
                {
                    MyCreate.ButtonLabel(des, 0, () =>
                    {
                        tmp = !tmp;
                    });
                    MyCreate.Shu(() =>
                    {
                        MyCreate.AddSpace(5);
                        if (null != action)
                        {
                            action();
                            if (isNeedSpace)
                            {
                                MyCreate.AddSpace();
                            }
                        }
                    });
                });
            });
            if (tmp && null != showAction)
            {
                showAction();
            }
            isShow = tmp;
        }