Skip to content

Instantly share code, notes, and snippets.

View benblo's full-sized avatar

Benoit FOULETIER benblo

View GitHub Profile
@benblo
benblo / CompilationTimeTracker.cs
Created February 11, 2019 11:47
Measure compilation times in Unity (import, compilation, domain reload). Can export results to a json Chrome trace file.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEditor;
using UnityEditor.Compilation;
@benblo
benblo / MIT-license.md
Last active July 14, 2017 21:59
This license applies to all public gists https://gist.github.com/benblo
@benblo
benblo / gist:d8b31eab90195208cc38
Last active May 6, 2023 10:43
Disable AudioManager from build script
var audioManager = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/AudioManager.asset")[0];
var serializedManager = new SerializedObject(audioManager);
var prop = serializedManager.FindProperty("m_DisableAudio");
prop.boolValue = true;
serializedManager.ApplyModifiedProperties();
@benblo
benblo / SceneUtility.cs
Created April 15, 2014 13:29
Utility to open all scenes of a Unity project and process them: resave, refactor data, etc. To be used with EditorCoroutines: https://gist.github.com/benblo/10732554
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using Object = UnityEngine.Object;
using UnityEditor;
namespace Swing.Editor
{
@benblo
benblo / EditorCoroutine.cs
Created April 15, 2014 13:26
EditorCoroutine: coroutines for Unity editor operations. Usage: EditorCoroutine.start(myIEnumerator)
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Swing.Editor
{
public class EditorCoroutine