Hallucination system
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unheimlich.Core.Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// Resets third-party static state that doesn't handle Domain Reload being disabled.
|
||||
/// Runs automatically at the start of every Play Mode session before the scene loads.
|
||||
/// </summary>
|
||||
internal static class GameSessionResetter
|
||||
{
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
private static void OnSessionStart()
|
||||
{
|
||||
ResetLeanTween();
|
||||
}
|
||||
|
||||
private static void ResetLeanTween()
|
||||
{
|
||||
// LeanTween holds a static tween array that persists when Domain Reload is disabled.
|
||||
// Stale tween IDs from the previous session cause callbacks to fire on wrong objects,
|
||||
// which breaks animations like organic shake on floating words.
|
||||
LeanTween.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34edfe05577b2a24892a90d9901cef39
|
||||
Reference in New Issue
Block a user