I have set up a simple custom Configuration thingy
trying to see if I can add it to this list
been digging through the engine source code and the inventory example, but I can't seem to find what i'm looking for.
Also can't seem to get ResourceContext to work such that the list shows up in the @unlockOutfit command but that may be because I don't fully understand how everything works. and yes I've tried "Update Metadata" to try to get the resource names to show up, but i'm obviously not connecting something together, here is what I have for code
Code: Select all
using Naninovel;
using UnityEngine;
namespace UnlockableOutfits
{
/// <summary>
/// Contains configuration data for the Unlockable Outfit system.
/// </summary>
[EditInProjectSettings]
public class UnlockableOutfitConfiguration : Configuration
{
/// <summary>
/// Used to distinguish unlockable outfit records among other resources.
/// </summary>
public const string DefaultPathPrefix = "UnlockableOutfit";
[Header("Outfit Options")]
public string[] Outfits;
//[Tooltip("Configuration of the resource loader used with unlockable outfit resources.")]
//public ResourceLoaderConfiguration Loader = new ResourceLoaderConfiguration { PathPrefix = DefaultPathPrefix };
// not sure if I need this
}
}
Code: Select all
using Naninovel;
using UnityEngine;
namespace UnlockableOutfits
{
[CommandAlias("unlockOutfit"),Documentation("A simple command to unlock outfits for main character.")]
public class UnlockOutfitCommand : Command
{
[RequiredParameter, ParameterAlias(NamelessParameterAlias), Documentation("Identifier of the outfit to unlock."),ResourceContext(UnlockableOutfitConfiguration.DefaultPathPrefix) ]
public NamedStringParameter outfit;
UnlockableOutfitManager outfitManager = Engine.GetService<UnlockableOutfitManager>(); // get access my outfit manager
public override UniTask ExecuteAsync (AsyncToken asyncToken = default)
{
outfitManager.Unlock(outfit); // just debug logs the input for now
return UniTask.CompletedTask;
}
}
}