Skip to content

Instantly share code, notes, and snippets.

View ryanmillerca's full-sized avatar

Ryan Miller ryanmillerca

View GitHub Profile
@ryanmillerca
ryanmillerca / PlatformBrancher.cs
Last active July 28, 2020 13:23
A simple script that lets you call UnityEvents based on the current platform (Windows, Mac, Debug, Steam, etc)
using UnityEngine;
using UnityEngine.Events;
public class PlatformBrancher : MonoBehaviour
{
public PlatformEvent[] onEnable;
public PlatformEvent[] onStart;
public PlatformEvent[] onDisable;
[Tooltip("to be called manually via PlatformBrancher.OnInvoke()")]
public PlatformEvent[] onInvoke;
@ryanmillerca
ryanmillerca / CustomAssetUtility.cs
Created June 9, 2020 20:37
ScriptableObject Helper
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using System.IO;
/// <summary>
/// Utility for creating ScriptableObject in Unity
/// </summary>
public static class CustomAssetUtility
{
@ryanmillerca
ryanmillerca / GroupUtility.cs
Last active May 18, 2020 16:22
Group tool for Unity3D
// Group Utility
// groups objects, registers Undo, and sets pivot as an average of children
// Made by Ryan Miller (https://www.ryanmiller.ca)
using UnityEngine;
using System.Collections;
using UnityEditor;
using System;
[ExecuteInEditMode]
@ryanmillerca
ryanmillerca / EventFerry.cs
Created May 18, 2020 16:18
Event Ferry (to connect Animation Events to UnityEvents)
// Event Ferry
// used to fake UnityEvent support into Animation Clip events.
// place on the gameObject with the Animator component
// call TriggerEvent with the index of the event previously specified
// Made by Ryan Miller (https://www.ryanmiller.ca)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
@ryanmillerca
ryanmillerca / AnimatorTransitionHelper.cs
Created May 18, 2020 16:16
AnimatorTransitionHelper for setting animator state transitions to Exit Time 1 etc quickly
// Animator transition helper
// Gives you shortcuts to set Animator Transitions (in Mecanim/State Machines)
// to an immediate trigger transition, or an exit time 1 trigger
// useful for people who don't want any blending but still want to use Mecanim!
// made by Ryan Miller https://www.ryanmiller.ca
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ryanmillerca
ryanmillerca / ScreenshotTool.cs
Last active May 20, 2020 03:46
Screenshot Tool for Unity3D (Capture iOS/Android screenshots)
// Screenshot Tool
// for use in Unity3D
// suitable for taking screenshots for iOS/Android app store pages
// made by Ryan Miller https://www.ryanmiller.ca
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
#if UNITY_EDITOR