Skip to content

Instantly share code, notes, and snippets.

View JLChnToZ's full-sized avatar
🥽
From game to XR experience

Jeremy Lam aka. Vistanz JLChnToZ

🥽
From game to XR experience
View GitHub Profile
@JLChnToZ
JLChnToZ / AutoPasswordPrompt.cs
Last active March 11, 2024 11:18
Prompt you to enter the keystore password if you forget before starting a new Android build in Unity.
using UnityEngine;
using UnityEditor;
using UnityEditor.Build;
public class AutoPasswordPrompt : EditorWindow {
[InitializeOnLoadMethod]
static void Register() => BuildPlayerWindow.RegisterBuildPlayerHandler(BuildHandler);
static bool IsUnfilled() =>
Shader "Unlit/PolyRhythmVisualizer" {
Properties {
_TimeCode ("Input Time", Float) = 0
_OuterRingFreq ("Outer Ring Frequency", Float) = 1
_InnerRingFreq ("Inner Ring Frequency", Float) = 0.922
_RingCount ("Ring Count", Int) = 35
_VibrantFreq ("Vibrant Frequency", Float) = 2
_Vibrant ("Vibrant", Range(0, 1)) = 0.5
_Decay ("Decay", Range(0, 10)) = 2
[Header(Cosine Gradiant)]
@JLChnToZ
JLChnToZ / Limitless.cs
Last active May 28, 2023 08:37
The dynamic access pass to any methods, properties and fields of any types and instances in C#.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Dynamic;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace JLChnToZ.CommonUtils.Dynamic {
using static LimitlessUtilities;
/// <summary>
@JLChnToZ
JLChnToZ / ObjectSnapshot.cs
Last active August 11, 2023 04:05
Take snapshots of properties of objects/components on play mode and re-apply them when stopped.
using System;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityObject = UnityEngine.Object;
@JLChnToZ
JLChnToZ / BoneEditorWindow.cs
Last active December 11, 2023 16:34
Unity's missing Skinned Mesh Bone Reference Editor
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEditor;
using UnityEditorInternal;
public class BoneEditorWindow : EditorWindow {
const string BASE_MENU_PATH = "CONTEXT/" + nameof(SkinnedMeshRenderer) + "/";
const string MENU_PATH = BASE_MENU_PATH + "Edit Bone References";
@JLChnToZ
JLChnToZ / MeshCombinerWindow.cs
Last active April 1, 2023 16:27
A clean mesh combiner for Unity
/**
* The MIT License (MIT)
*
* Copyright (c) 2023 Jeremy Lam aka. Vistanz
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@JLChnToZ
JLChnToZ / VideoShaderCommon.cginc
Created July 13, 2022 12:10
A simple shader for VRChat for SBS 3D video playback support with aspect ratio handling.
// Configurations
// 2D: stereoShift = float4(0, 0, 0, 0), stereoExtend = float2(1, 1)
// SBS (LR): stereoShift = float4(0, 0, 0.5, 0), stereoExtend = float2(0.5, 1)
// SBS (RL): stereoShift = float4(0.5, 0, 0, 0), stereoExtend = float2(0.5, 1)
// Over-Under (Left above): stereoShift = float4(0, 0.5, 0, 0), stereoExtend = float2(1, 0.5)
// Over-Under (Right above): stereoShift = float4(0, 0, 0, 0.5), stereoExtend = float2(1, 0.5)
// Size Mode: 0 = Stratch, 1 = Contain, 2 = Cover
float4 getVideoTexture(sampler2D videoTex, float2 uv, float4 texelSize, bool avPro, int sizeMode, float aspectRatio, float4 stereoShift, float2 stereoExtend) {
float srcAspectRatio = texelSize.y * texelSize.z * stereoExtend.x / stereoExtend.y;
@JLChnToZ
JLChnToZ / vrchatlog.ps1
Last active August 4, 2022 16:42
Live view VRChat runtime log on console legally (mod-free)
$Host.UI.RawUI.WindowTitle = 'VRChat Log'
$Host.UI.RawUI.BackgroundColor = 'Black'
$Host.PrivateData.VerboseForegroundColor = 'White'
Clear-Host
Get-Content -Tail $Host.UI.RawUI.BufferSize.Height -Wait -Encoding UTF8 (Get-ChildItem -Path "$($Env:LocalAppData)Low\VRChat\VRChat" -Filter 'output_log_*.txt' | Sort-Object LastWriteTime -Descending | Select-Object -First 1 | ForEach-Object {$_.FullName}) | Where-Object {$_.Trim() -ne ''} | ForEach-Object {
if ($_ -match '^\d{4}\.\d{2}\.\d{2}\s\d{2}:\d{2}:\d{2}\sError') {
$Host.UI.RawUI.ForegroundColor = $Host.PrivateData.ErrorForegroundColor
$Host.UI.RawUI.BackgroundColor = $Host.PrivateData.ErrorBackgroundColor
} elseif ($_ -match '^\d{4}\.\d{2}\.\d{2}\s\d{2}:\d{2}:\d{2}\sException') {
$Host.UI.RawUI.ForegroundColor = $Host.PrivateData.ErrorForegroundColor
@JLChnToZ
JLChnToZ / cyrillic.user.js
Last active May 27, 2022 11:32
A user script that will transliterates all Latin characters to Cyrillic. Just for fun.
// ==UserScript==
// @name Cyrillic?
// @namespace JLChnToZ
// @grant none
// @version 1.0
// @author -
// @description Transliterates all Latin characters to Cyrillic.
// ==/UserScript==
(() => {
const transliterate = ((latin, cyrillic) => {
using UnityEngine;
#if UNITY_EDITOR
using System;
using System.Linq;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEditor.Build;