Skip to content

Instantly share code, notes, and snippets.

View wotakuro's full-sized avatar

Yusuke Kurokawa wotakuro

View GitHub Profile
@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 / AlwaysCreateGPUProgramAtEditor.cs
Last active January 21, 2022 07:39
Shader.CreateGPUProgramをUnityEditorで常に呼び出されるようにしたい!!
// UnityEditor上ではShaderオブジェクトが残ったままになります
// 一度 Shader.CreateGPUProgramが走ってしまうと、その後に再生してもShader.CreateGPUProgramは残りません。
// なので、Editor上で余計なCreateGPUProgramを発見
//
// 使い方、このソースコードをプロジェクト内に入れてください。
// そして「Tools/UTJ/AlwaysCraateGPUProgram/Enable」をチェックしてください
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
@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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace UTJ
{
// window
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.UnityLinker;
using UnityEngine;
@wotakuro
wotakuro / ShaderParseWatcher.cs
Created November 24, 2020 05:28
ProfilerのShader.Parseをウォッチして、ファイルに書き込む君
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
using System.IO;
using System.Text;
public class ShaderParseWatcher : MonoBehaviour
{
using UnityEngine;
public class CameraViewer : MonoBehaviour
{
// Update is called once per frame
void Update()
{
if (Application.isMobilePlatform)
{
@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のログに埋め込みします
@wotakuro
wotakuro / PackageManagerAutoInstaller.cs
Last active May 29, 2020 15:42
PackageManagerを自動で入れる君
/**
MIT License
Copyright (c) 2019 Yusuke Kurokawa
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
@wotakuro
wotakuro / StrippingByVariantCollection.cs
Last active February 7, 2022 12:43
プロジェクト内にあるShaderVariantCollectionにないKeywordはビルドに含まないようにするEditor拡張です
/*
MIT License
Copyright (c) 2020 Yusuke Kurokawa
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