Browse Source

Merge pull request #889 from snozbot/feature/LogCommandExceptionLocation

Add Log of Location for Command Execute Exceptions
master
Steve Halliwell 4 years ago
parent
commit
32b9534cd1
  1. 13
      Assets/Fungus/Scripts/Components/Block.cs

13
Assets/Fungus/Scripts/Components/Block.cs

@ -312,7 +312,20 @@ namespace Fungus
// set it here in case a command starts and finishes execution before the next window update. // set it here in case a command starts and finishes execution before the next window update.
command.ExecutingIconTimer = Time.realtimeSinceStartup + FungusConstants.ExecutingIconFadeTime; command.ExecutingIconTimer = Time.realtimeSinceStartup + FungusConstants.ExecutingIconFadeTime;
BlockSignals.DoCommandExecute(this, command, i, commandList.Count); BlockSignals.DoCommandExecute(this, command, i, commandList.Count);
#if UNITY_EDITOR
try
{
command.Execute();
}
catch (Exception)
{
Debug.LogError("Rethrowing Exception thrown by:" + command.GetLocationIdentifier());
throw;
}
#else
command.Execute(); command.Execute();
#endif
// Wait until the executing command sets another command to jump to via Command.Continue() // Wait until the executing command sets another command to jump to via Command.Continue()
while (jumpToCommandIndex == -1) while (jumpToCommandIndex == -1)

Loading…
Cancel
Save