Skip to content

Instantly share code, notes, and snippets.

View VictorHHT's full-sized avatar
🤠
Working Hard at Recreate Games

Victor He VictorHHT

🤠
Working Hard at Recreate Games
  • China
  • 04:29 (UTC +08:00)
View GitHub Profile
@AnzyGit
AnzyGit / AnzyAccessModifiersCheatSheet.cs
Last active December 20, 2023 02:59
Access modifiers cheat sheet in UNITY
using UnityEngine;
public class CommonAccessModifiers : MonoBehaviour
{
// VISIBLE/EDITABLE from the inspector, this script
// and other scripts
public int MyCounter1;
// VISIBLE/EDITABLE in this script, and VISIBLE
// in other scripts
@VictorHHT
VictorHHT / VTMinMaxSlider.cs
Last active March 5, 2023 13:11
Unity MinMaxSlider Property Attribute, with carefully crafted OnGUI drawing to achieve a similar interaction logic like the piano key velocity MinMaxSlider in Apple's GarageBand
using System;
using UnityEditor;
using UnityEngine;
namespace Victor.Tools
{
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public sealed class VTMinMaxSlider : PropertyAttribute
{
internal Vector2 m_MinmaxLimit;
@VictorHHT
VictorHHT / VTRangeStep.cs
Last active April 19, 2024 23:30
Unity Range Step Slider Property Attribute, allow the user to increase a float value or int value by step, like 0.25f or 3 or 100.15f
using System;
using UnityEditor;
using UnityEngine;
// Use Example 1: [VTRangeStep(0f, 10f, 0.25f)]
// Use Example 2: [VTRangeStep(100, 1000, 25)]
namespace Victor.Tools
{
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public sealed class VTRangeStep : PropertyAttribute
@CDillinger
CDillinger / FuzzyMatch.cs
Last active July 25, 2023 09:17
C# Implementation of Fuzzy Match
// LICENSE
//
// This software is dual-licensed to the public domain and under the following
// license: you are granted a perpetual, irrevocable license to copy, modify,
// publish, and distribute this file as you see fit.
using System;
using System.Collections.Generic;
public static class FuzzyMatcher