using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
public GameObject prefab;
public GameObject wuti;
// Use this for initialization
void Start () {
//unity的构造方法
//第一种
Object.Instantiate(prefab,new Vector3(12,45,56),Quaternion.identity);
//第二种:通过GameObject()方法new一个新物体
//wuti=new GameObject("这就是我");
//第三种,
GameObject.CreatePrimitive(PrimitiveType.Sphere);
}
// Update is called once per frame
void Update () {
}
}
c#:创建物体
于 2022-04-01 18:26:59 首次发布