1.localScale:成员变量,组件挂载的游戏物体的本地缩放
2.forward:成员变量,组件挂载的游戏物体的本地坐标的Z轴正方向
3.right:成员变量,组件挂载的游戏物体的本地坐标的X轴正方向
4.up:成员变量,组件挂载的游戏物体的本地坐标的Y轴正方向
1.localScale:成员变量,组件挂载的游戏物体的本地缩放
2.forward:成员变量,组件挂载的游戏物体的本地坐标的Z轴正方向
3.right:成员变量,组件挂载的游戏物体的本地坐标的X轴正方向
4.up:成员变量,组件挂载的游戏物体的本地坐标的Y轴正方向
1.eulerAngles:成员变量,组件挂载的游戏物体的旋转
2.parent:成员变量,组件挂载的游戏物体的父级
3.localPosition:成员变量,组件挂载的游戏物体的本地坐标
4.localRotation:成员变量,组件挂载的游戏物体的本地旋转
1.gameObject:成员变量,组件挂载的游戏物体
2.childCount:成员变量,组件挂载的游戏物体的子对象个数
3.position:成员变量,组件挂载的游戏物体的世界坐标
No6_Transform
06_Transform
1.查找子级组件
public GameObject enemyGos;
enemyGos.GetComponentInChildren<BoxCollider>();
enemyGos.GetComponentsInChildren<BoxCollider>();
2.查找父级组件
enemyGos.GetComponentInParent<BoxCollider>();
enemyGos.GetComponentsInParent<BoxCollider>();
1.No5_Component no5_Component=gameObject.GetComponent<No5_Component>();
1.Destroy(),静态方法,销毁游戏物体
2.FindObjectOfType(),静态方法
3.Instantiate()
4.
MonoBehaviour
1. enabled:成员变量,组件激活状态
2.name:成员变量,组件挂载的对象名称
3.tag:成员变量,组件挂载的标签名称
4.isActiveAndEnabled:成员变量,组件是否已激活并启用Behaviour
1.GameObject[] enemyGos=GameObject.FindGameObjectsWithTag(“ Enemy”);
2.BoxCollider[] colliders=GameObject.、findObjectOfType<BoxCollider>();
1.通过标签查找
GameObject.FindGameObject WithTag(“MainCamera”);
2.通过类型查找
No2_EventFunction no2_EventFunction= GameObject.FindObjectOfType<No2_EventFunction>();
1.activeInHierarchy:成员变量,游戏物体的激活或失活状态
2.activeSelf:成员变量,游戏物体的激活或失活状态
3.通过名称查找
GameObject mainCameraGo = GameObject.Find(“Main Camera”);
1.Instantiate:静态方法,实例化克隆
2. CreatePrimitive:静态方法,创建原始几何体
3.SetActive:成员方法,激活或失活游戏物体
4.tag:成员变量,标签
5.layer:成员变量,层级
创建游戏物体方式
1.使用构造函数
GameObject myGo = new GameObject("MyGameObject");
2.根据现有的预制体(游戏物体)资源或者游戏场景已有的游戏物体来实例化。
GameObject.Instantiate(grisGo);
3.使用特别的API创建
OnApplicatoinquit()
LateUpdate()
Start()
OnEnable()
1.
Awake()
Mute 静音
yancdiaoyogn