This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
[InitializeOnLoad] | |
public static class EditorHelper | |
{ | |
#region Constructors | |
static EditorHelper() | |
{ | |
EditorApplication.wantsToQuit += OnEditorWantsToQuit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void ExecuteTests() | |
{ | |
// Select all types in appdomain | |
var types = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).ToArray(); | |
// Need to create an empty runner filter | |
var filterType = types.First(t => t.Name == "TestRunnerFilter"); | |
var filter = Activator.CreateInstance(filterType); | |
// Create a test launcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityCommonLibrary; | |
using UnityEngine; | |
/// <summary> | |
/// Application lifecycle management class | |
/// </summary> | |
public static class GameApp | |
{ | |
/// <summary> | |
/// Active service container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Linq; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using UnityEngine; | |
public static class SceneListExporter | |
{ | |
[DidReloadScripts] | |
[MenuItem("Assets/Generate Scene List")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityCommonLibrary; | |
using UnityCommonLibrary.Messaging; | |
using System; | |
public static class Services | |
{ | |
public class DebugServiceLocator : ServiceLocator | |
{ | |
protected override void RegisterServices() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
using System.Collections.Generic; | |
using System.IO; | |
using UnityEngine; | |
public static class AssetManager | |
{ | |
private const string ASSET_PATH = "Assets/_core/bundled_assets"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CreateAssetMenu] | |
public class AssetLookup : ScriptableObject | |
{ | |
private static AssetLookup _get; | |
public static AssetLookup get | |
{ | |
get | |
{ | |
if(_get) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
[CreateAssetMenu(menuName = "KingMe/ColorPalette")] | |
public class ColorPalette : ScriptableObject | |
{ | |
[SerializeField] | |
private List<NamedColor> list = new List<NamedColor>(); | |
public static Color GetColor(string palette, string key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MenuItem("Game Tools/CompoundColliderBuilder")] | |
private static void DoCompoundCollider() | |
{ | |
var obj = Selection.activeGameObject; | |
var meshCollider = obj.GetComponent<MeshCollider>(); | |
if (!meshCollider) | |
{ | |
return; | |
} | |
var meshBounds = meshCollider.bounds; |