1、重要成员
(1)获取依附的GameObject:即成员变量gameObject(.name获取物体名字)
(2)获取依附的GameObject的位置信息
(gameObject.) transform(.positon 位置信息/ .eulerAngle 角度信息/ .lossycale 缩放大小)
(3)获取脚本是否激活
this.enabled = true/false;
(this可以替换成其他绑定对象,如otherScript(.gameObject/.transform/.enabled)
2、重要方法
(1)得到依附对象上挂载的其他脚本
注:如果有重复相同的多个脚本,通过此方法无法确定得到的是哪个脚本
i. 得到自己挂载的单个脚本,根据脚本名获取
脚本名 t = this.GetComponent("脚本名“) as 脚本名
如果获取失败,没有对应的脚本,返回空null
ii. 根据Type获取
脚本名 t = this.GetComponent(typeof(脚本名)) as 脚本名
iii. 根据泛型获取,建议使用泛型获取,因为不用二次转换
脚本名 t = this.GetComponent<脚本名>();
(2&#