This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Text.RegularExpressions; | |
using System.IO; | |
// Drop this in some Editor folder | |
public static class AnimatorControllerTool { | |
[MenuItem("CONTEXT/RuntimeAnimatorController/Enforce Transition Settings")] | |
public static void FixTransitions(MenuCommand command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Keeps track of elapsed time, and is able to pause, resume & seek. | |
/// It's bound to Time.time, so time scaling will affect this. | |
/// </summary> | |
public struct Stopwatch | |
{ | |
/// <summary> | |
/// How much time has passed for this stopwatch | |
/// </summary> | |
public float Elapsed => Time.time - epoch - (pausedEpoch > 0f ? (Time.time - pausedEpoch) : 0f); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// For consumers of config fields | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public struct ConfigValue<T> { | |
public T Value | |
#if UNITY_EDITOR | |
=> field.Value; | |
#else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ScriptableInst<T> where T : ScriptableFactory<T> | |
{ | |
public T SharedData { get; internal set; } | |
public ScriptableInst() | |
{ | |
} | |
public ScriptableInst(T sharedData) | |
{ |