Skip to content

Instantly share code, notes, and snippets.

@cosmogonies
cosmogonies / PrefabApplyCallback.cs
Last active March 8, 2022 14:36
Callback on Apply Prefab (Unity)
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
internal class PrefabExtension
{
static PrefabExtension()
{
UnityEditor.PrefabUtility.prefabInstanceUpdated += OnPrefabInstanceUpdate;
}
@cosmogonies
cosmogonies / CG_RandomManager.cs
Last active November 10, 2021 14:10
Deterministic random manager, where you can dump into your code a random array (to freeze it), with also the option to have it neutral (average=median value).
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/*
Deterministic random manager, where you can dump into your code a random array (to freeze it),
with also the option to have it neutral (average=median value).
*/
public class RandomSequence
{ //Auxiliary function to dump into code a random sequence, to freeze it, control it.