1、AutoRotation cmp1=(AutoRotation) GetComponent(typeof(AutoRotation));
2、AutoRotation cmp2=(AutoRotation) GetComponent("AutoRotation");
3、AutoRotation cmp3= GetComponent<AutoRotation>();
unity3d GetComponent
最新推荐文章于 2025-04-19 16:36:09 发布
本文介绍了在Unity游戏开发环境中通过不同方式获取AutoRotation组件的方法。这些方法包括使用typeof关键字和直接指定类型名称来获取指定游戏对象上的AutoRotation组件。

6362

被折叠的 条评论
为什么被折叠?



