Skip to content

Instantly share code, notes, and snippets.

View wotakuro's full-sized avatar

Yusuke Kurokawa wotakuro

View GitHub Profile
@wotakuro
wotakuro / ShaderCBufferAnalyer.cs
Created April 13, 2026 07:24
Unity CBUFFER ANLYZER
using UnityEngine;
using UnityEditor;
using UnityEngine.Rendering;
using UnityEditor.Rendering;
using System.Collections.Generic;
namespace UTJ.Sample
{
public class ShaderConstantBufferAnalyzer : EditorWindow
@wotakuro
wotakuro / AsyncReadManagerSyncReadSample.cs
Last active March 3, 2026 01:10
AsyncReadManagerが同期読み込みでも使えたサンプルです
using UnityEngine;
using Unity.IO.LowLevel.Unsafe;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
// AsyncReadManagerを使った同期ファイル読み込みです
// AndroidでもStreamingAsset以下にあるファイルにアクセスすることが可能になっています
public class AsyncReadManagerSyncReadSample : MonoBehaviour
{
void Start()
@wotakuro
wotakuro / GraphicsStateCollectionSeparatorUI.cs
Created November 17, 2025 00:49
GraphicsStateCollectionをMergeしたり、分割するサンプル
using UnityEngine;
using UnityEditor;
using UnityEngine.UIElements;
using UnityEditor.UIElements;
using UnityEngine.Experimental.Rendering;
using UnityEditor.Playables;
namespace UTJ.Sample
{
public class GraphicsStateCollectionSeparatorUI : EditorWindow
@wotakuro
wotakuro / WebGLUtility.cs
Last active February 9, 2025 09:22
Unity WebGLUtility
using UnityEngine;
using UnityEditor;
using System;
using System.Reflection;
namespace UTJ
{
public class WebGLUtility
{
private static Type httpServerEditorWrapperType;
@wotakuro
wotakuro / GraphicStateCollectionViewer.cs
Created October 10, 2024 01:57
GraphicStateCollectionのInspectorだと情報見にくかったので用意
using UnityEditor;
using UnityEngine;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
using UnityEngine.Experimental.Rendering;
using System.Collections.Generic;
using UnityEngine.Rendering;
using System.Text;
namespace UTJ
@wotakuro
wotakuro / RenderingGpuWatcher.cs
Last active October 3, 2024 05:19
Unity 2021.2+URPで画面にGPU処理時間を出します
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine.UI;
#if DEBUG
@wotakuro
wotakuro / StreamingAssetsDynamicTest.cs
Created January 16, 2023 07:57
StreamingAssetsをプラットフォームごとに分ける
using UnityEditor.Build;
using UnityEditor;
public class StreamingAssetsDynamicTest : BuildPlayerProcessor
{
public override void PrepareForBuild(BuildPlayerContext buildPlayerContext)
{
var buildTarget = buildPlayerContext.BuildPlayerOptions.target;
#if DEBUG
using UnityEngine;
using Unity.Profiling.LowLevel.Unsafe;
using System;
using Unity.Profiling.LowLevel;
using Unity.Profiling;
using Unity.Collections.LowLevel.Unsafe;
using System.Runtime.CompilerServices;
using System.Diagnostics.Contracts;
using System.Diagnostics;
@wotakuro
wotakuro / SerializedObjectDebugWindow.cs
Created February 7, 2024 08:29
SerializedObjectDebugWindow
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.UIElements;
using UnityEditor.UIElements;
using System.IO;
using System.Text;
public class SerializedObjectDebugWindow : EditorWindow
@wotakuro
wotakuro / ReserchForShaderStrip.cs
Last active October 6, 2023 08:21
[Unity]ShaderVariantのStripを調べる君
/**
* ビルドをしたりすると描画がおかしくなってしまうと言う事が起きているので、
* ビルド時のShaderVariant周りをログに書き出すデバッグ機能を作りました
*
* これは、IPreprocessShaders(Stripping scriptable shader variants)でログ書き出しのみを行う事で実現しています。
* https://blog.unity.com/engine-platform/stripping-scriptable-shader-variants
*
* デフォルト挙動では、プロジェクト直下に「ShaderBuildLog」というフォルダを作成し、
* ビルドのタイムスタンプごとにフォルダを作成するようにしています
*