Implemented Animation Clip asset and animation controller #410
|
@ -308,6 +308,7 @@ namespace SHADE
|
|||
auto& newClip {animContainer->clips.emplace_back()};
|
||||
newClip.name = name;
|
||||
assetCollection.emplace(id, asset);
|
||||
assetCollection[parent].subAssets.push_back(&assetCollection[id]);
|
||||
assetData.emplace(id, &newClip);
|
||||
return id;
|
||||
}
|
||||
|
|
|
@ -249,13 +249,26 @@ namespace SHADE
|
|||
{
|
||||
std::vector<Handle<SHAnimationClip>> animClips;
|
||||
|
||||
const auto ALL_ANIM_CLIPS = SHAssetManager::GetAllRecordOfType(AssetType::ANIM_CLIP);
|
||||
for (auto asset : ALL_ANIM_CLIPS)
|
||||
//const auto ALL_ANIM_CLIPS = SHAssetManager::GetAllRecordOfType(AssetType::ANIM_CLIP);
|
||||
//for (auto asset : ALL_ANIM_CLIPS)
|
||||
//{
|
||||
// const SHAnimClipAsset* ANIM_CLIP = SHAssetManager::GetData<SHAnimClipAsset>(asset.id);
|
||||
// if (ANIM_CLIP->animRawDataAssetId == rawAnimId)
|
||||
// {
|
||||
// animClips.emplace_back(SHResourceManager::LoadOrGet<SHAnimationClip>(asset.id));
|
||||
// }
|
||||
//}
|
||||
|
||||
const auto ALL_ANIM_CLIPS = SHAssetManager::GetAllRecordOfType(AssetType::ANIM_CONTAINER);
|
||||
for (auto const& asset : ALL_ANIM_CLIPS)
|
||||
{
|
||||
const SHAnimClipAsset* ANIM_CLIP = SHAssetManager::GetData<SHAnimClipAsset>(asset.id);
|
||||
auto const ANIM_CLIP {SHAssetManager::GetData<SHAnimClipContainerAsset>(asset.id)};
|
||||
if (ANIM_CLIP->animRawDataAssetId == rawAnimId)
|
||||
{
|
||||
animClips.emplace_back(SHResourceManager::LoadOrGet<SHAnimationClip>(asset.id));
|
||||
for (auto const& subAsset : asset.subAssets)
|
||||
{
|
||||
animClips.emplace_back(SHResourceManager::LoadOrGet<SHAnimationClip>(subAsset->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue