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 System.Collections; | |
using UnityEditor; | |
[CustomEditor (typeof(TriggerContainer))] | |
public class TriggerContainerEditor : Editor | |
{ | |
private SerializedObject obj; |
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 System.Collections; | |
public class MonoBehaviourSingleton<T> : MonoBehaviour | |
where T : Component | |
{ | |
private static T _instance; | |
public static T Instance { | |
get { | |
if (_instance == null) { |
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
var E_PREFIX_RATE = 0.25; | |
// All of our word lists: | |
var _word_lists = { | |
verb : [ | |
"implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", "embrace", | |
"enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", "enhance", "incentivize", | |
"morph", "empower", "envisioneer", "monetize", "harness", "facilitate", "seize", "disintermediate", |
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
/* | |
* Created by C.J. Kimberlin (http://cjkimberlin.com) | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2014 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
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; | |
using System.Collections.Generic; | |
#if UNITY_EDITOR | |
using System.Reflection; | |
using System.Linq; | |
#endif | |
public static class Extensions | |
{ | |
#region float |
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 System.Collections; | |
public static class ExtensionMethods { | |
public static Vector3 GetScreenPosition(Transform transform, Canvas canvas, Camera cam) | |
{ | |
Vector3 pos; |
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
/// @creator: Slipp Douglas Thompson | |
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>. | |
/// @purpose: Forwards keyed events to a KeyedEventActions component elsewhere. | |
/// @why: Because this functionality should be built-into Unity. | |
/// @usage: Needs to be put on the same GameObject as the Mecanim Animator component or “legacy” Animation component. | |
/// Animation events should be configured in the Unity Editor's Animation timeline view or model import settings › Animations tab › Events disclosure (or via the scripting API, I suppose) to call “Function: Action, Parameter String: «your-decided-key-string-for-this-action»”. | |
/// @intended project path: Assets/Utils/EventAction/KeyedEventActionForwarder.cs | |
/// @interwebsouce: https://gist.github.com/capnslipp/50db1dc724514bb3db91 | |
using System; |
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; | |
public static class ColliderExtensions { | |
public static bool IsVisibleFrom(this Collider collider, Camera camera) | |
{ | |
Plane[] planes = GeometryUtility.CalculateFrustumPlanes(camera); | |
return GeometryUtility.TestPlanesAABB(planes, collider.bounds); | |
} | |
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
/// @creator: Slipp Douglas Thompson | |
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>. | |
/// @purpose: More-flexible GO-tree searching for Components by type, configurable via `SearchExtent` enum arg. | |
/// @why: Because this functionality should be built-into Unity. | |
/// @usage: Call `this.gameObject.FindComponent<«component-type»>(«SearchExtent-type»);`. | |
/// @intended project path: Assets/Plugins/UnityEngine Extensions/GameObjectFindComponentExtension.cs | |
/// @interwebsouce: https://gist.github.com/capnslipp/ac26e38fce770b5c4594 | |
using System; | |
using UnityEngine; |
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 UnityEngine.Events; | |
using System.Collections; | |
/* | |
Event class for catching Unity Message Events that are sent to the GameObject's attached components. | |
Events that are captured here are sent from the GameObjectHelper class | |
*/ | |
[AddComponentMenu("Event/Catch Event")] |
OlderNewer