#include "actor.h"
#include "asset/asset_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)
	{
		Model* model = AssetManager::GetSingletonPtr()->LoadAsset<Model>(property.path, property.flags);
		return new ActorMesh(*model, property);
	}
	ActorMesh* ActorMesh::New(uint32_t id)
	{
		ActorProperty* property = Property::GetProperty<ActorProperty>(id);
		if (property) {
			return New(*property);
		}
		return nullptr;
	}
}
