GetComponent

GetComponent 的几种写法:
1、AutoRotation cmp1=(AutoRotation) GetComponent(typeof(AutoRotation));

2、AutoRotation cmp2=(AutoRotation) GetComponent("AutoRotation");

3、AutoRotation cmp3= GetComponent<AutoRotation>();
posted @ 2014-02-17 20:50  赵青青  阅读(1110)  评论(0编辑  收藏  举报