Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
namespace Game.Util
{
public class FluentFsm<TState, TEvent>
where TState : Enum
where TEvent : Enum
{
readonly Dictionary<TState, State> _states = new Dictionary<TState, State>();
@vindroid-shaw
vindroid-shaw / CustomPreviewExample.cs
Created March 24, 2025 10:27 — forked from chrisyarbrough/CustomPreviewExample.cs
This shows how UnityEditor.PreviewRenderUtility can be used to draw a custom scene and render it interactively in an editor window. The target object can be modified while running, but it is important to note, that in this case we need to managed target instantiation and destruction ourselves.
using UnityEditor;
using UnityEngine;
/// <summary>
/// Demonstrates how to use <see cref="UnityEditor.PreviewRenderUtility"/>
/// to render a small interactive scene in a custom editor window.
/// </summary>
public class CustomPreviewExample : EditorWindow
{
[MenuItem("My Tools/Custom Preview")]