Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zaikman
zaikman / SuspendableAppController.cs
Last active May 28, 2019 19:37
A sub-classed UnityAppController that allows a tvOS application to be manually suspended, to circumvent Unity issue #1134856. To use, place both files in a Plugin/tvOS folder in your Unity project and call UnityEngine.tvOS.Application.ExitToHomeScreen to suspend the application.
#if UNITY_TVOS
namespace UnityEngine
{
namespace tvOS
{
public class Application
{
[System.Runtime.InteropServices.DllImport("__Internal")]
extern static public void ExitToHomeScreen();
}
@zaikman
zaikman / FindDerivedTypesFromAssembly.cs
Created August 13, 2015 03:43
Method for finding all types in an assembly that derive from a particular base type
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public static class EditorExtensions
{
/// <summary>
/// FindDerivedTypesFromAssembly allows a user to query all of types derived from a
/// particular Type at runtime.