Skip to content

Instantly share code, notes, and snippets.

@mcaisw
mcaisw / .UIDocumentLocalization.cs.md
Created July 21, 2025 01:54 — forked from andrew-raphael-lukasik/.UIDocumentLocalization.cs.md
Text localization script for UIDocument (UI Toolkit @ Unity)

pattern to follow

// NOTE: this class assumes that you designate StringTable keys in label fields (as seen in Label, Button, etc) // and start them all with '#' char (so other labels will be left be)

@mcaisw
mcaisw / DragManipulator.cs
Created November 29, 2023 08:52 — forked from shanecelis/DragManipulator.cs
This manipulator makes a visual element draggable at runtime in Unity's UIToolkit.
/* Original code[1] Copyright (c) 2022 Shane Celis[2]
Licensed under the MIT License[3]
[1]: https://gist.github.com/shanecelis/b6fb3fe8ed5356be1a3aeeb9e7d2c145
[2]: https://twitter.com/shanecelis
[3]: https://opensource.org/licenses/MIT
*/
using UnityEngine;
using UnityEngine.UIElements;
/// <summary>
/// Curved Layout Group Created by Freezy - http://www.ElicitIce.com
/// Posted on Unity Forums http://forum.unity3d.com/threads/script-curved-layout.403985/
///
/// Free for any use and alteration, source code may not be sold without my permission.
/// If you make improvements on this script please share them with the community.
///
/// </summary>
namespace UnityEngine.UI.Extensions
@mcaisw
mcaisw / Deformable.cs
Created July 16, 2020 12:20 — forked from Nordaj/Deformable.cs
Runtime mesh deformation on impact script for Unity.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Deformable : MonoBehaviour
{
//Public
public float minImpulse = 2;
public float malleability = 0.05f;
public float radius = 0.1f;
//参考: http://wiki.unity3d.com/index.php?title=Singleton
using UnityEngine;
public abstract class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T>
{
private static T instance = null;
public static T Instance {
get {
//Scene内にあったら取得
@mcaisw
mcaisw / ReferenceFinder.cs
Last active November 15, 2017 03:17 — forked from ffyhlkain/ReferenceFinder.cs
A reference finder for assets in a #Unity3d project.
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
namespace XYFoundationEditor.Editor.ReferenceFinder
{