GetComponent
GetComponent 的几种写法:
1、AutoRotation cmp1=(AutoRotation) GetComponent(typeof(AutoRotation));
2、AutoRotation cmp2=(AutoRotation) GetComponent("AutoRotation");
3、AutoRotation cmp3= GetComponent<AutoRotation>();
GetComponent 的几种写法:
1、AutoRotation cmp1=(AutoRotation) GetComponent(typeof(AutoRotation));
2、AutoRotation cmp2=(AutoRotation) GetComponent("AutoRotation");
3、AutoRotation cmp3= GetComponent<AutoRotation>();