Unity3D:NGUI官方控件学习

来源:互联网 发布:推荐美图软件 编辑:程序博客网 时间:2024/06/05 22:52

iOS和Unity3D一起学习,正好公司购买了这2款软件


复习:

3个boxCollider,4种状态变化

Tween的Height,width两种方式的变化


    void OnClick(){
        print ("哈哈哈");
        UISprite sprite = GetComponent<UISprite> ();
        sprite.spriteName = "Emoticon - Laugh";
        TweenRotation tr=TweenRotation.Begin(gameObject,1f,Quaternion.Euler(0f,0f,100f));
        EventDelegate.Add(tr.onFinished,MyCallBack);
    }
    void MyCallBack()
    {
        TweenRotation.Begin(gameObject,1f,Quaternion.identity);
    }

另外一种写法:

    void OnClick(){
        print ("哈哈哈");
        UISprite sprite = GetComponent<UISprite> ();
        sprite.spriteName = "Emoticon - Laugh";
        TweenRotation tr=TweenRotation.Begin(gameObject,1f,Quaternion.Euler(0f,0f,100f));
        EventDelegate.Add(tr.onFinished,delegate(){TweenRotation.Begin(gameObject,1f,Quaternion.identity);});
    }


0 0
原创粉丝点击