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

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

3、AutoRotation cmp3= GetComponent<AutoRotation>();
05-11 15:48