Skip to content

Instantly share code, notes, and snippets.

View fangzhangmnm's full-sized avatar

fangzhangmnm fangzhangmnm

View GitHub Profile
/**********
Hides a field in the inspector in Unity3D according to the value of a boolean or enum field.
Warning: Code is blind-generated by AI without human inspection, use at your own risk.
Usage:
// Show 'myField' only when 'isEnabled' is true
public bool isEnabled;
[ConditionalField("isEnabled")]
/**********
This script adds a simple Unity Editor window that allows you to control the Time.timeScale
Warning: Code is blind-generated by AI without human inspection, use at your own risk.
Author: chatgpt.com
Supervisor: fangzhangmnm, Jan.9 2026
License: MIT
**********/
#if UNITY_EDITOR
@fangzhangmnm
fangzhangmnm / EditorFullscreenToggle.cs
Last active January 9, 2026 07:02
Toggle fullscreen in Unity3D using F11 hotkey
/*********
This script enables F11 to toggle fullscreen mode in the Unity Editor.
Warning: Code is blind-generated by AI without human inspection, use at your own risk.
Author: chatgpt.com
Supervisor: fangzhangmnm, Jan.9 2026
License: MIT
*********/
#if UNITY_EDITOR
/*********
This script adds a button to the Unity Inspector for any parameterless method
by adding a [Button] attribute above the method definition.
Warning: Code is blind-generated by AI without human inspection, use at your own risk.
Usage:
[Button]
private void MyMethod()
{
//https://gist.github.com/fangzhangmnm/38eeeca077db38d0e0b7af53a620947b
//Credit: Inspired by noriben's work https://booth.pm/ja/items/1671087
//reference https://docs.unity3d.com/Manual/SL-VertexFragmentShaderExamples.html
Shader "fzmnm/mobileWaterToon"
{
Properties
{
@fangzhangmnm
fangzhangmnm / GridPaintEditor.cs
Last active March 1, 2022 04:51
Unity3D paint prefabs on grid
//https://gist.github.com/fangzhangmnm/bdb16f3970c2158c3bb829bf2685bb94
// credits: https://www.synnaxium.com/en/2019/01/unity-custom-map-editor-part-1/
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.IO;
@felixjones
felixjones / pmx21.md
Last active January 1, 2026 02:22
PMX (Polygon Model eXtended) 2.0, 2.1 File Format Specifications

PMX (Polygon Model eXtended) 2.1

This is an English description of the .PMX file format used in Miku Miku Dance (MMD).

PMX is the successor to the .PMD format (Polygon Model Data).

This is work-in-progress! Please leave feedback in the comments.

Todo