コード例 #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;
        }
コード例 #2
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;
         });
     });
 }
コード例 #3
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);
        }
コード例 #4
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);
        }
コード例 #5
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;
        }