Files
Cielonos/Assets/OtherPlugins/Sprite Shaders Ultimate/Scripts/UnscaledTimeSSU.cs

27 lines
601 B
C#
Raw Normal View History

2025-12-22 18:36:29 -05:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace SpriteShadersUltimate
{
[AddComponentMenu("Sprite Shaders Ultimate/Utility/Unscaled Time SSU")]
[ExecuteAlways]
public class UnscaledTimeSSU : MonoBehaviour
{
public bool dontDestroyOnLoad;
void Awake()
{
if(dontDestroyOnLoad && Application.isPlaying)
{
DontDestroyOnLoad(gameObject);
}
}
void Update()
{
Shader.SetGlobalFloat("UnscaledTime", Time.unscaledTime);
}
}
}