unity3d修改对象属性
unity3d修改对象属性
#region void loadWorkerModel(Vector3 init_position, string worker_name,string BDID) { GameObject obj = (GameObject)Instantiate(Resources.Load("Prefabs/Worker_commomn")); obj.transform.position = init_position; obj.AddComponent<CapsuleCollider>();//添加碰撞 obj.GetComponent<CapsuleCollider>().radius = 1; obj.GetComponent<CapsuleCollider>().height = 1; obj.name = worker_name; obj.AddComponent<WorkerPositionController>();//加载脚本 obj.transform.parent = this.transform; string str_BDID = BDID.Remove(0, BDID.Length - 2); obj.GetComponent<WorkerPositionController>().setWorkerIDText(str_BDID); } #endregion
################
QQ 3087438119