Skip to content

Instantly share code, notes, and snippets.

@PopupAsylumUK
PopupAsylumUK / AutoNameAnimations.cs
Last active January 3, 2024 22:49
Automatically renames animations on import from "Take 001" or "mixamo.com" to the name of their import, which I find more useful
using UnityEditor;
using UnityEngine;
public class AutoNameAnimations : AssetPostprocessor {
static readonly string[] renameMatches = new string[] { "Take 001", "mixamo.com" };
void OnPostprocessModel(GameObject gameObject) {
ModelImporter importer = assetImporter as ModelImporter;
using UnityEngine;
public class DistanceJoint3D : MonoBehaviour {
public Transform ConnectedRigidbody;
public bool DetermineDistanceOnStart = true;
public float Distance;
public float Spring = 0.1f;
public float Damper = 5f;
@staggartcreations
staggartcreations / CinemachinePathShape.cs
Created January 5, 2020 08:51
Unity script for creating a circular, arched or spiraling cinemachine path
using UnityEngine;
using Cinemachine;
using Waypoint = Cinemachine.CinemachineSmoothPath.Waypoint;
public class CinemachinePathShape : MonoBehaviour
{
public CinemachineSmoothPath path;
[Space]
@6ilberM
6ilberM / DebugCameraController.cs
Created September 4, 2020 18:08
A simple Floating Camera Controller for Unity, using Unity's "New Input System".
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.EnhancedTouch;
using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;
[AddComponentMenu("Debug/Float Camera Controller")]
public class DebugCameraController : MonoBehaviour
{
public float lookSpeedH = 5f;