Skip to content

Instantly share code, notes, and snippets.

using System.Runtime.CompilerServices;
static class HashUtils {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int CombineWith(this int hash1, int hash2) => (hash1 * 397) ^ hash2;
}
static RenderTexture TopDownPreview(GameObject prefab, RenderTexture rt, Camera Camera, Transform Root) {
var instance = Object.Instantiate(prefab, Root);
instance.hideFlags = HideFlags.DontSave;
Camera.targetTexture = rt;
Camera.Render();
Object.DestroyImmediate(instance);
Camera.targetTexture = null;
return rt;
}
async Routine EnabledDisabledFlow() {
while (true) {
await Routine.Yield;
if (!enabled)
await Routine.TryAwait(() => enabled)
.Configure(child: DisabledFlow());
await Routine.TryAwait(() => !enabled)
.Configure(child: EnabledFlow());
using System;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine.UIElements;
class PathApi {
public string MonoPath;
public string Dir() {