Skip to content

Instantly share code, notes, and snippets.

View 123tris's full-sized avatar
😁
I love deleting code

Tristan Metz 123tris

😁
I love deleting code
View GitHub Profile
@123tris
123tris / SceneHistoryWidget.cs
Created January 19, 2023 03:02 — forked from jringrose/SceneHistoryWidget.cs
Drop this into an Editor folder in your project to add a history widget to your scene view. Supports going backwards and forwards through your recent scene history, as well as a dropdown of all recently edited scenes. Also supports the back/forwards buttons on your mouse! Doesn't support multi-scene editing very well, though.
#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
@123tris
123tris / RealtimeDebugger.cs
Last active May 10, 2021 17:53
A Unity debugger window that allows you to subscribe values you want to debug in realtime easily
#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>();
@123tris
123tris / ReadOnly.cs
Created February 5, 2021 23:43
ReadOnly attribute for Unity
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace Utility
{
public class ReadOnlyAttribute : PropertyAttribute
{
}
@123tris
123tris / $CooldownManagerExample.cs
Last active January 22, 2024 00:45
A unity script for easily delaying parts of your code
//----------- 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
@123tris
123tris / UpdateRootMotion.cs
Created November 7, 2019 20:21
A statemachinebehaviour to toggle rootmotion when entering or exiting animation states in Unity
using UnityEngine;
public class UpdateRootMotion : StateMachineBehaviour
{
public bool onStateEnter;
public bool applyRootMotionOnEnter;
public bool onStateExit;
public bool applyRootMotionOnExit;