Error Handling
This commit is contained in:
parent
54168a4a4d
commit
d40132370d
|
@ -16,12 +16,20 @@ namespace Syntriax.Modules.Factory
|
||||||
if (IsInitialized)
|
if (IsInitialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OnFactoryInitialize();
|
|
||||||
|
|
||||||
IsInitialized = true;
|
IsInitialized = true;
|
||||||
|
|
||||||
OnInitialized?.Invoke(this);
|
try
|
||||||
OnStateChanged?.Invoke(this);
|
{
|
||||||
|
OnFactoryInitialize();
|
||||||
|
|
||||||
|
OnInitialized?.Invoke(this);
|
||||||
|
OnStateChanged?.Invoke(this);
|
||||||
|
}
|
||||||
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
|
Debug.LogError(e);
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
|
@ -29,12 +37,19 @@ namespace Syntriax.Modules.Factory
|
||||||
if (!IsInitialized)
|
if (!IsInitialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OnFactoryReset();
|
|
||||||
|
|
||||||
IsInitialized = false;
|
IsInitialized = false;
|
||||||
|
|
||||||
OnReset?.Invoke(this);
|
try
|
||||||
OnStateChanged?.Invoke(this);
|
{
|
||||||
|
OnFactoryReset();
|
||||||
|
|
||||||
|
OnReset?.Invoke(this);
|
||||||
|
OnStateChanged?.Invoke(this);
|
||||||
|
}
|
||||||
|
catch (System.Exception e)
|
||||||
|
{
|
||||||
|
Debug.LogError(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc cref="Initialize"/>
|
/// <inheritdoc cref="Initialize"/>
|
||||||
|
|
Loading…
Reference in New Issue