Skip to content

Instantly share code, notes, and snippets.

//visible[0] is an AnimBool, you can cache it somewhere in your custom editor.
using (new EditorUtils.FoldoutScope(visible[0], out var shouldDraw, "SongItem"))
{
if (shouldDraw)
{
//draw the rest of your GUI.
songItem = EditorGUILayout.ObjectField(songItem, typeof(SongItem), false) as SongItem;
}
}
@aras-p
aras-p / DebugNode.hlsl
Created January 3, 2020 10:37
"Print a value" custom function node code for Unity ShaderGraph
// Quick try at doing a "print value" node for Unity ShaderGraph.
// Tested on Unity 2019.2.17 with ShaderGraph 6.9.2.
//
// Use with CustomFunction node, with two inputs:
// - Vector1 Value, the value to display,
// - Vector2 UV, the UVs of area to display at.
// And one output:
// - Vector4 Color, the color.
// Function name is DoDebug.