Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
guitarrapc / FindTest.cs
Last active January 4, 2022 18:30
Unity Benchmark for FindXxxx Method. refer : http://baba-s.hatenablog.com/entry/2014/07/09/093240
using System;
using UnityEngine;
/// <summary>
/// Find 関数の処理速度を計測するスクリプト
/// </summary>
public sealed class FindTest : MonoBehaviour
{
public int LoopCount = 1000; // 1 回のテストで Find 関数を実行する回数
public int TestCount = 10; // テストの回数
@mandarinx
mandarinx / optimizations.md
Last active July 27, 2025 08:12
Unity3D optimization tips

Unity3D optimization tips

Some code allocates memory when running in the editor and not on the device. This is due to Unity doing some extra error handling so possible error messages can be output in the console. Much of this code is stripped during build. It's therefore important to profile on device, and do it regularly.

Optimizations often makes code more rigid and harder to reason. Don't do it until you really need to.

When profiling, wrap methods or portions of a method in Profiler.BeginSample(string name) and Profiler.EndSample() to make them easier to find in the profiler.

public class SomeClass {

How to Use?

GUIStyle mystyle = new GUIStyle("some string from the list below");


UnityEditor.ConsoleWindow.Constants

  • "CN Box"
  • "Button"
@ZimM-LostPolygon
ZimM-LostPolygon / UnityGuidRegenerator.cs
Last active June 3, 2024 07:38
Unity asset GUIDs regenerator
// Drop into Assets/Editor, use "Tools/Regenerate asset GUIDs"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {