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; | |
public class UpdateRootMotion : StateMachineBehaviour | |
{ | |
public bool onStateEnter; | |
public bool applyRootMotionOnEnter; | |
public bool onStateExit; | |
public bool applyRootMotionOnExit; |
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
//----------- Example code ----------- | |
float health = 5; | |
CooldownManager.Cooldown(2, () => health++); //Delay health increment by 2 seconds | |
CooldownManager.Cooldown(5, Shoot); //Invoke shoot in 5 seconds | |
void Shoot () { } | |
//If you dont want to use lambda's for functions with parameters you can overload the function like so: | |
CooldownManager.Cooldown(2, Damage, 5); //Calls Damage() function with damageValue 5 after 2 seconds have passed |
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
#if UNITY_EDITOR | |
using UnityEditor; | |
using UnityEngine; | |
namespace Utility | |
{ | |
public class ReadOnlyAttribute : PropertyAttribute | |
{ | |
} |
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
#if UNITY_EDITOR | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
//Made for only testing purposes so use at own discretion | |
public class RealtimeDebugger : EditorWindow | |
{ | |
static Dictionary<string, object> debugProperties = new Dictionary<string, object>(); |
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
#if UNITY_EDITOR | |
/* | |
MIT License | |
Copyright (c) 2016 Jesse Ringrose | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights |
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 UnityEngine.Assertions; | |
public static class CachedReference<T> where T : MonoBehaviour | |
{ | |
private static T cachedReference; | |
/// <summary> Returns null when it cannot find the type </summary> | |
public static T FindCachedObject(bool includeInactive = true) | |
{ |
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 UnityEngine.Assertions; | |
public class Singleton<T> : BaseBehaviour where T : MonoBehaviour | |
{ | |
public static T Instance => GetInstance(); | |
/// <summary>GetInstance gets called by the getter Instance, however GetInstance can be used to get extra control such as turning off exceptions and allowing null or generate the instance when it can't be found </summary> | |
public static T GetInstance(bool throwException = true, bool generateInstance = false) | |
{ |