Unity3D:NGUI官方控件学习

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);});
    }


猜你喜欢

转载自blog.csdn.net/sap_support/article/details/51682727