Skip to content

Instantly share code, notes, and snippets.

View kesera2's full-sized avatar
🍀
I'm happy

kesera2 kesera2

🍀
I'm happy
View GitHub Profile
@kesera2
kesera2 / TextureMaterialSyncWindow.cs
Last active October 7, 2025 16:52
【まめふれんず対応】CC0ぱんつ【無料】https://kesera2.booth.pm/items/6186804 に付随しているUnity拡張Editorのソースコードです。
using UnityEditor;
using UnityEngine;
using System.IO;
using System.Linq;
using UnityEngine.UIElements;
namespace kesera2.MamefriendsCC0Pants
{
public class TextureMaterialSyncWindow : EditorWindow
{
@kesera2
kesera2 / BlenderStyleSceneView.cs
Last active September 15, 2025 07:57
Numロック中のsceneの操作をBlenderチックに変えるやつです。 Assets/Editor/BlenderStyleSceneView.csとして保存して使ってください。 操作方法: Num1 = Front, Ctrl + Num1 = Back, Num3 = Left, Ctrl + Num3 = Right, Num7 = Top, Ctrl + Num7 = Bottom, Num5 = Toggle Perspective, comma = Forcus, Num 2,4,6,8 Rotate 15°, Ctrl + Num2,4,6,8 = Pan Camera
using System.Reflection;
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public static class BlenderStyleSceneView
{
private static readonly float rotateStep = 15f;
private static readonly float panStep = 0.5f;
bl_info = {
"name": "Recursive Bone Rename",
"author": "kesera2",
"version": (1, 2),
"blender": (3, 0, 0),
"location": "View3D > Sidebar > Tool Tab",
"description": "Rename bones recursively under root bones if name contains target string",
"category": "Armature",
}
@kesera2
kesera2 / delete_child_bones.py
Created May 31, 2025 13:06
Blender remove chile bones script
import bpy
# 子ボーンを再帰的に削除する関数
def delete_child_bones(bone, armature):
children = bone.children[:]
for child in children:
delete_child_bones(child, armature)
armature.data.edit_bones.remove(child)
# ボーンとその子ボーンを削除するオペレーター
@kesera2
kesera2 / VelocityJumpCountGame.cs
Last active April 20, 2025 10:50
Udonsharp Playground
using TMPro;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
public class VelocityJumpCountGame : UdonSharpBehaviour
{
private const float Multiplier = 10f;
[SerializeField] private TextMeshProUGUI jumpCountGUI;
[SerializeField] private TextMeshProUGUI maxJumpCountGUI;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
public class CubeController : UdonSharpBehaviour
{
[SerializeField] private GameObject cube;
private readonly float jumpImpulse = 3.0f;
private readonly float runSpeed = 2.0f;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using VRC.SDK3.Dynamics.PhysBone.Components;
public class PhysBoneCopierWindow : EditorWindow
{
[SerializeField] private GameObject prefabRoot; // 元のGameObject
[SerializeField] private GameObject searchRoot; // 探索するGameObject
[SerializeField] private bool isDeleteEnabled = true;
@kesera2
kesera2 / github
Last active June 7, 2024 17:34
githubコマンドを打つとgithubをブラウザで開いてくれるやつ
#!/bin/bash
#### NOTE: /bin/github に配置してね ###
# 現在のディレクトリがGitリポジトリかどうかチェック
if ! git rev-parse --is-inside-work-tree &> /dev/null; then
echo "Error: This directory is not a Git repository."
exit 1
fi
@kesera2
kesera2 / OVERVIEW.md
Last active January 15, 2024 08:43
[C#] Animator Controllerのステートとステートマシンのトランジションを取得表示する

State -> Sub State Machine、Sub State Machine -> Stateへのトランジションを取得した際のメモ

Animator Controllerのレイヤー例

image

出力例

image
@kesera2
kesera2 / ResetTransform.cs
Last active September 25, 2023 12:45
【Unity】Transfromのリセットのショートカット
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Reflection;
[InitializeOnLoad]
public class ResetTransform
{
static ResetTransform()