mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-10 15:53:19 +00:00
28 lines
575 B
C#
28 lines
575 B
C#
using System;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.Utility
|
|
{
|
|
public class UnityHelper : MonoBehaviour
|
|
{
|
|
public static UnityHelper Instance { get; private set; }
|
|
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
public void RunWhen(Func<bool> when, Action what)
|
|
{
|
|
StartCoroutine(WaitUntil(when, what));
|
|
}
|
|
|
|
private IEnumerator WaitUntil(Func<bool> when, Action what)
|
|
{
|
|
yield return new WaitUntil(when);
|
|
what();
|
|
}
|
|
|
|
}
|
|
} |