Skip to content

Instantly share code, notes, and snippets.

View wotakuro's full-sized avatar

Yusuke Kurokawa wotakuro

View GitHub Profile
@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」というフォルダを作成し、
* ビルドのタイムスタンプごとにフォルダを作成するようにしています
*
@wotakuro
wotakuro / GetShaderVariantsExtention.cs
Last active January 5, 2023 15:10
GetShaderVariantsExtention
/**
MIT License
Copyright (c) 2022 Unity Technologies Japan
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
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@wotakuro
wotakuro / WebGLUtility.cs
Last active January 4, 2023 08:40
Unity WebGLUtility
using UnityEngine;
using UnityEditor;
using System;
using System.Reflection;
namespace UTJ
{
public class WebGLUtility
{
private static Type httpServerEditorWrapperType;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Profiling;
using UnityEngine.UI;
using System.Text;
using Unity.Profiling.LowLevel.Unsafe;
public class ReleaseBuildRecordCheck : MonoBehaviour
{
@wotakuro
wotakuro / ObjectRegisterWatchExample.cs
Created December 21, 2022 10:34
Unity ObjectRegister.WatchSample( Unity 2022 +)
using UnityEditorInternal;
using UnityEditor.Profiling;
using UnityEditor;
public class ObjectRegisterWatchExample
{
[MenuItem("Tools/ExecuteTest")]
public static void Execute()
{
int objRegistmaker = FrameDataView.invalidMarkerId;
@wotakuro
wotakuro / UnityEditor拡張便利群.txt
Last active September 27, 2022 08:09
UnityEditor拡張便利群
1.プロジェクトのアセットをザクっと見渡すツールです
https://github.com/wotakuro/AssetsReporter
2.300フレーム毎にProfilerログを保存することで300フレーム上限問題を回避します。
https://github.com/wotakuro/UnityProfilerIntervalSave
3.Profilerのログを分割する事で、300フレーム上限問題を回避します
https://github.com/wotakuro/ProfilerBinarylogSplit
4.ScreenShotをProfilerのログに埋め込みします