Skip to content

Instantly share code, notes, and snippets.

LotteMakesStuff / InspectorButtonsTest.cs
Last active Jul 1, 2021
Code running pack! two property drawing scripts that make it super easy to trigger code via buttons in the inspector, and get feedback! [TestButton] draws you little buttons that call a method on your MonoBehaviour, and [ProgressBar] give you a great way to show feedback from long running methods. These are *super* helpful for things like proced…
View InspectorButtonsTest.cs
using UnityEngine;
using System.Collections;
public class InspectorButtonsTest : MonoBehaviour
[TestButton("Generate world", "DoProcGen", isActiveInEditor = false)]
[TestButton("Clear world", "ClearWorld", 2, isActiveInEditor = false)]
[ProgressBar(hideWhenZero = true, label = "procGenFeedback")]
public float procgenProgress = -1;