Update the cards to pull in from addressables to wokr in build, remove erronous code preventing building
This commit is contained in:
@@ -4,8 +4,10 @@ using System.Linq;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using AppleHills.UI.CardSystem;
|
||||
using UnityEditor;
|
||||
using UnityEditor.AddressableAssets.Settings;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using AppleHills.Editor.Utilities;
|
||||
|
||||
namespace AppleHills.Editor.CardSystem
|
||||
{
|
||||
@@ -1078,7 +1080,20 @@ namespace AppleHills.Editor.CardSystem
|
||||
// Mark as dirty and save
|
||||
EditorUtility.SetDirty(_selectedCard);
|
||||
AssetDatabase.SaveAssets();
|
||||
|
||||
|
||||
// Add to Addressables group "BlokkemonCards" and apply "BlokkemonCard" label
|
||||
string assetPath = AssetDatabase.GetAssetPath(_selectedCard);
|
||||
if (!string.IsNullOrEmpty(assetPath))
|
||||
{
|
||||
if (AddressablesUtility.EnsureAssetInGroupWithLabel(assetPath, "BlokkemonCards", "BlokkemonCard"))
|
||||
{
|
||||
AddressablesUtility.SaveAddressableAssets();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("Failed to add card to Addressables. Please ensure Addressables are set up in this project.");
|
||||
}
|
||||
}
|
||||
// Clear dirty flag
|
||||
_isDirty = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user