UNITY动态加载预制体
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LoadCube : MonoBehaviour {
// Use this for initialization
void Start () {
GameObject hp_bar = (GameObject)Resources.Load("Cube");
hp_bar = Instantiate(hp_bar);
hp_bar.name = "Cube";
}
// Update is called once per frame
void Update () {
}
}

浙公网安备 33010602011771号