#include "actor.h"
#include "asset/resource_manager.h"
#include "data/property/actor_property.h"
namespace engineapi {
	ActorMesh::ActorMesh(Model& model, ActorProperty& property)
		:DynamicMesh(model)
		,mProperty(property)
	{

	}
	ActorMesh* ActorMesh::New(ActorProperty& property)
	{
		auto res = ResourceManager::GetSingleton().Load<Model>(property.path);
		return new ActorMesh(*res, property);
	}
	ActorMesh* ActorMesh::New(uint32_t id)
	{
		ActorProperty* property = Property::GetProperty<ActorProperty>(id);
		if (property) {
			return New(*property);
		}
		return nullptr;
	}
}
