您好,欢迎来到99网。
搜索
您的当前位置:首页UGUI

UGUI

来源:99网

Chapter1
处理touch

void Update()
    {
        if(!Application.isMobilePlatform)
        {
            if(Input.GetMouseButtonUp(0))
            {
                GetComponent<CubeGenerator>().Generate();
            }
        }
        else
        {
            if(Input.touchCount >= 1)
            {
                Touch touch = Input.GetTouch(0);
                if(touch.phase == TouchPhase.Began)
                {
                    GetComponent<CubeGenerator>().Generate();
                }
            }
        }
    }

快捷键
F2 rename
alt shift A hide/show gameobject

Chapter3
读取sprite
selectedSprites.AddRange(AssetDatabase.LoadAllAssetsAtPath(
AssetDatabase.GetAssetPath(texture)).OfType());

正则表达测试

排序的例子

string suffixPattern = "_?([0-9]+)$";
        selectedSprites.Sort((Sprite _1, Sprite _2)=>{
            Match match1 = Regex.Match(_1.name, suffixPattern);
            Match match2 = Regex.Match(_2.name, suffixPattern);
            if(match1.Success && match2.Success)
            {
                return (int.Parse(match1.Groups[1].Value) - 
                    int.Parse(match2.Groups[1].Value));
            }
            else
            {
                return _1.name.CompareTo(_2.name);
            }
        });

using
The reason for the “using” statement is to ensure that the object is disposed as soon as it goes out of scope, and it doesn’t require explicit code to ensure that this happens.

Mono ctrl + V bug
Funny thing is you can also paste in the search (ctrl-f), then select all (ctrl-a) .. Copie and then your paste will work…

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 99spj.com 版权所有 湘ICP备2022005869号-5

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务