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
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>propgetc</Title> | |
<Shortcut>propgetc</Shortcut> | |
<Description>Unity Code snippet for property and backing field with lazy GetComponent call</Description> | |
<Author>Jon Kenkel</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
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
#ifndef _ENUM_MASK | |
#define _ENUM_MASK | |
#include <cstddef> | |
#include <bitset> | |
//struct for ensuring an enum has a count element. | |
//this does NOT validate that the count element is the last element | |
template<class T> | |
struct has_enum_count { |
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
#include "HashedString.h" | |
namespace Engine | |
{ | |
unsigned int HashedString::Hash(const char * i_string) | |
{ | |
assert(i_string); | |
return Hash(reinterpret_cast<void *>(const_cast<char *>(i_string)), strlen(i_string)); |
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 UnityEditor; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
[InitializeOnLoad] | |
public class AssetDefinePostprocessor : AssetPostprocessor | |
{ |
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
/// <summary> | |
/// Interface for objects that can be inserted into a Pool. | |
/// These objects should use the Poolable attribute to define their spawn behaviour | |
/// </summary> | |
/// <example> | |
/// public class TestObject : MonoBehaviour, IPoolable | |
/// { | |
/// public void OnGenerate() { } | |
/// public void OnCheckout() { } |
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; | |
using System.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Trigger3D class | |
/// | |
/// A trigger is considered ACTIVE when there is at least one object inside of it. |
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; | |
[RequireComponent(typeof(HasHealth))] | |
public class DestroyWhenDead : MonoBehaviour | |
{ | |
HasHealth health; | |
///Lazy getter is safe here, because we used RequireComponent | |
public HasHealth Health { | |
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 UnityEngine; | |
using System.Collections; | |
/// <summary> | |
/// Camera Follower | |
/// | |
/// Causes a camera to follow the position of a provided transform, and optionally it's x/y/z rotatations. | |
/// The camera can zoom out, in either orthographic or perspective mode and is limited on both ends. | |
/// | |
/// Do NOT parent this component's gameobject to the follow transform. It must be at the same transform level, or higher. |
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; | |
using System.Collections; | |
/// <summary> | |
/// Class for holding singleton component instances in Unity. | |
/// </summary> | |
/// <example> | |
/// [UnitySingleton(UnitySingletonAttribute.Type.LoadedFromResources, false, "test")] | |
/// public class MyClass : UnitySingleton<MyClass> { } |
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")] |