Пример #1
0
        public void OnClickUpdate()
        {
            DemoData d = DemoContext.Instance.Data;

            d.UserName          = "******" + M4uUtil.Random(1, 100);
            d.UserId            = M4uUtil.Random(1, 100);
            d.CharaSprite       = M4uUtil.LoadSprite("CommonAtlas", ("common_button_" + M4uUtil.Random(1, 3)));
            d.Atk               = M4uUtil.Random(0, 100);
            d.Def               = M4uUtil.Random(0, 100);
            d.BackgroundTexture = M4uUtil.LoadTexture("banner_" + M4uUtil.Random(1, 4));
            d.SoundVolume       = M4uUtil.Random(0f, 1f);
            d.ScrollValue       = M4uUtil.Random(0f, 1f);
            d.IsSet             = (M4uUtil.Random(0, 2) == 0);
            d.Description       = string.Format("My name is {0}!", d.UserName);
            d.ProgressTitle     = "Now progress is ";
            d.Progress          = M4uUtil.Random(0, 100);

            this.CharaX = M4uUtil.Random(-300, 300);
            this.CharaY = M4uUtil.Random(-430, -360);

            Vector3 rot = DemoContextMono.CharaRot;

            DemoContextMono.CharaRot = new Vector3(rot.x, rot.y, M4uUtil.Random(-180, 180));
        }
Пример #2
0
        public void OnClickUpdate()
        {
            CheckString     = (M4uUtil.Random(0, 2) == 0) ? CheckSuccess : CheckFail;
            CheckEnum       = (M4uUtil.Random(0, 2) == 0) ? CheckType.OK : CheckType.NG;
            BoolBindingText = CheckString + "/" + CheckEnum.ToString();

            var time = Time.time;
            var src  = Color;
            var dst  = new UnityEngine.Color(M4uUtil.Random(0f, 1f), M4uUtil.Random(0f, 1f), M4uUtil.Random(0f, 1f), 1f);

            StartCoroutine(UpdateColor(time, src, dst));

            FontStyle            = (UnityEngine.FontStyle)M4uUtil.Random(0, 4);
            FontSize             = M4uUtil.Random(30, 50);
            LineSpacing          = M4uUtil.Random(1f, 2f);
            SupportRichText      = (M4uUtil.Random(0, 2) == 0);
            Alignment            = (TextAnchor)M4uUtil.Random(3, 6);
            ResizeTextForBestFit = (M4uUtil.Random(0, 2) == 0);
            Text  = "[Special]\n";
            Text += "FontStyle=" + FontStyle.ToString() + "\n";
            Text += "LineSpacing=" + LineSpacing + "\n";
            Text += "SupportRichText=" + SupportRichText + "\n";
            Text += "Alignment=" + Alignment.ToString() + "\n";
            Text += "ResizeTextForBestFit=" + ResizeTextForBestFit;
        }