using UnityEngine; using System.Collections.Generic; /// <summary> /// Sprite is a textured element in the UI hierarchy. /// </summary> /// public partial class UISprite : UIBasicSprite { public void OnInitNew() { OnInit(); } } /// <summary…
调用其它组件中成员 通过GameObject(游戏物体). Base class for all entities in Unity scenes. 是Unity场景里面所有实体的基类. 可以理解为两个类间的访问,定义一个超类用其中一个类实现. 默认的gameObject为当前组件.transform为变换,有常用属性position(Vector3三维向量). 熟记transform下属性和方法作用. transform.translate() 平移,给定vector3,给定坐标系'物体坐标…
GetCreateObject: using UnityEngine; public class GetCreateObject : MonoBehaviour { GameObject emptyGo; Light goLight; GameObject goCamera; public Camera pCamera; public Transform goRoot; Transform transLight; GameObject tank; void Start () { //创建物体:在…