Skip to content

Instantly share code, notes, and snippets.

@Kleptine
Kleptine / AssistantVisuals.cs
Created July 14, 2022 21:30
Clone Arms Rigging in The Last Clockwinder
// Copyright 2022 John Austin - Pontoco
// License: MIT
// https://choosealicense.com/licenses/mit/
// This is the rigging code that is used to calculate IK and place arm bones in The Last Clockwinder.
// It began using the Unity Animation Rigging package, but we found that to be too slow and overly separated into too many
// trivial jobs (it was dominated by scheduling time).
// This code is largely the result of manually inlining all of the rigging code we were using from our Animation Rigging setup.
// You'll notice that it's well setup to run as a Job! But we never needed the extra performance. In face, just running this code 25 times
@Kleptine
Kleptine / fbx_check.cs
Created April 10, 2021 14:41
Tools for checking FBX import/export settings in Unity.
[MenuItem("Assets/Check FBX for Issues")]
private static void CheckFBX()
{
var paths = Selection.assetGUIDs.Select(s =>
Path.GetFullPath(Path.Combine(Application.dataPath, "..", AssetDatabase.GUIDToAssetPath(s)))).ToArray();
var exe = Path.GetFullPath(Path.Combine(Application.dataPath, "..", "..", "Tools", "Hooks",
"fbx_sanitizer.exe"));
// Start the child process.
@Kleptine
Kleptine / PlacerTool.cs
Created March 29, 2021 18:55
A Unity editor tool mode (like Translate, Rotate, etc) that lets you click/drag to position objects in the scene.
// Author: John Austin
// Licensed under MIT License
using System;
using System.Reflection;
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEditor.ShortcutManagement;
using UnityEngine;
@Kleptine
Kleptine / ConstructionScript.cs
Last active September 7, 2023 21:54
A Construction Script is a system to help generate procedural Gameobjects at Edit-Time in a Unity scene.
using System.Linq;
using UnityEngine;
#if UNITY_EDITOR
using System;
using UnityEditor;
#endif
namespace Global.Scripts.ConstructionScript
{
@Kleptine
Kleptine / ConstructionScript.cs
Created March 16, 2020 02:36
A Construction Script is a system to help generate procedural Gameobjects at Edit-Time in a Unity scene. It does /// three main things: /// <para>1. Generates a child gameobject wrapped in a <see cref="HideFlags.DontSave" /> gameobject.</para> /// <para> /// 2. Runs a set of <see cref="IOnConstruct" /> scripts on this generated object, whenever …
using System.Linq;
using UnityEngine;
#if UNITY_EDITOR
using System;
using UnityEditor;
#endif
namespace Global.Scripts.ConstructionScript
{