其他分享
首页 > 其他分享> > UNITY动态加载预制体

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 () {
		
	}
}

  

标签:Cube,bar,hp,System,UNITY,Collections,预制,using,加载
来源: https://www.cnblogs.com/guangzhiruijie/p/15825017.html