- 最后登录
- 2019-12-2
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 34660
- 纳金币
- 38266
- 精华
- 111
|
using System.Reflection;// 反射 (需要加入头文件)
Offset = GetComponent(“MainBoardTopJS”);
FieldInfo OffsetXFieldInfo = Offset.GetType().GetField(“OffsetX”);
OffsetX = (float)OffsetXFieldInfo.GetValue(Offset);
----------或----------------------------------------------------
using System.Reflection;// 反射 (需要加入头文件)
Component X;
FieldInfo OffsetXFieldInfo;
X = GetComponent(“ToAngleAxis”);
OffsetXFieldInfo = X.GetType().GetField(“rotationX”);
rotationX = (float)OffsetXFieldInfo.GetValue(X);
----------------------------------------------------------------------
using System.Reflection;// 反射
Component Offset = GetComponent(“MainBoardTopJS”);
FieldInfo OffsetXFieldInfo = Offset.GetType().GetField(“OffsetX”);
OffsetX = (float)OffsetXFieldInfo.GetValue(Offset);
|
|