make mat editor list and set soundassets

This commit is contained in:
AzaezelX 2021-10-14 19:07:36 -05:00
parent adbd6d0711
commit c2fdb733fa

View file

@ -95,11 +95,15 @@ function MaterialEditorGui::open(%this)
%sounds = "<None>" TAB "<Soft>" TAB "<Hard>" TAB "<Metal>" TAB "<Snow>"; // Default sounds %sounds = "<None>" TAB "<Soft>" TAB "<Hard>" TAB "<Metal>" TAB "<Snow>"; // Default sounds
// Get custom sound datablocks %assetQuery = new AssetQuery();
foreach (%db in DataBlockSet) AssetDatabase.findAssetType(%assetQuery, "SoundAsset");
%count = %assetQuery.getCount();
// Get custom sound assets
for(%i=0; %i < %count; %i++)
{ {
if (%db.isMemberOfClass("SFXTrack")) %assetId = %assetQuery.getAsset(%i);
%sounds = %sounds TAB %db.getName(); %sounds = %sounds TAB %assetId;
} }
%count = getFieldCount(%sounds); %count = getFieldCount(%sounds);
@ -1504,7 +1508,7 @@ function MaterialEditorGui::updateBehaviorSound(%this, %type, %sound)
} }
%this.updateActiveMaterial(%type @ "SoundId", %defaultId); %this.updateActiveMaterial(%type @ "SoundId", %defaultId);
%this.updateActiveMaterial("custom" @ %type @ "Sound", %customName); %this.updateActiveMaterial("custom" @ %type @ "SoundAsset", %customName);
} }
function MaterialEditorGui::updateSoundPopup(%this, %type, %defaultId, %customName) function MaterialEditorGui::updateSoundPopup(%this, %type, %defaultId, %customName)