UnityIngameDebugConsole
UnityIngameDebugConsole copied to clipboard
Add the possible to add custom suggestion to each parameter
It would be appreciate if we could have the capacity to add suggestion for the "Character" and "BuffName" parameters.
[ConsoleMethod("buff", "Apply a buff to the given character")]
public static void ApplyBuff(string character, string buffName)
{
if (GameFlowManager.Instance.CurrentState is Battle battle)
{
if (character == "player")
{
BattleCharacter battleCharacter = battle.BattleCharacters.FirstOrDefault(x => x.Agent is BattlePlayerAgent);
if (battleCharacter == null)
{
Debug.LogWarning($"The is no battle character owned by the player during the execution of the command \"buff\".");
}
List<BattleBuffDefinition> battleBuffDefinitions = AssetProviderManager.Instance.Get<BattleBuffDefinition>();
BattleBuffDefinition battleBuffDefinition = battleBuffDefinitions.FirstOrDefault(x => x.name == buffName);
if (battleBuffDefinition == null)
{
Debug.LogWarning($"Could not find the buff with the name \"{buffName}\" during the execution of the command \"buff\".");
}
battleCharacter.BattleBuffApplier.Apply(battleBuffDefinition, battleCharacter);
}
else
{
Debug.LogWarning($"Could not resolve \"{character}\" as a valid parameter for the command \"buff\".");
}
}
else
{
Debug.LogWarning("The command \"buff\" can only be used in a \"Battle\".");
}
}