一.Resource资源
TPAC文件中MetaMesh,Material,Texture为系统资源
[EngineClass("rglResource")]
public abstract class Resource : NativeObject
{
}
二.获取系统资源
<1.获取Mesh
Mesh mesh = Mesh.GetFromResource(string meshName)
<2.获取material
Material material = Material.GetFromResource(string materialName)
<3.获取Shader
Shader shader = Shader GetFromResource(string shaderName)
<4.获取Texture
<5.获取PhysicsShape
三.使用系统资源
<1.添加Mesh至GameEntity中
MetaMesh metaMesh = MetaMesh.CreateMetaMesh(null);
metaMesh.addMesh(mesh);
GameEntity.AddComponent(metaMesh);