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

  

上一篇:Unity基础知识、Transform类


下一篇:Unity——ShaderLab纹理动画