public void Initialize(double taskGuessRate) { stepScheme = StepScheme; currentSteps = null; try { //Clone list so we don't risk modifying script memory currentSteps = scriptObject.ExecuteFunction <List <int> >("Initialize", context, ParameterCount).ToList(); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"Initialize\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"Initialize\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"Initialize\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"Initialize\" failed with error: {excp.Message}."); } }
public void Initialize(double taskGuessRate) { stepScheme = StepScheme; try { currentStep = scriptObject.ExecuteFunction <int>("Initialize", context); } catch (ScriptRuntimeException excp) { UnityEngine.Debug.LogError($"Runtime Error: \"Initialize\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Runtime Error", bodyText: $"Runtime Error: \"Initialize\" failed with error: {excp.Message}."); } catch (Exception excp) { UnityEngine.Debug.LogError($"Error: \"Initialize\" failed with error: {excp.Message}."); ModalDialog.ShowSimpleModal(ModalDialog.Mode.Accept, headerText: "Error", bodyText: $"Error: \"Initialize\" failed with error: {excp.Message}."); } }
public static string ToDisplayName(this StepScheme scheme) { switch (scheme) { case StepScheme.Relative: return("Relative"); case StepScheme.Absolute: return("Absolute"); default: UnityEngine.Debug.LogError($"Unexpected StepScheme: {scheme}"); return(""); } }