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; | |
public static class DictionaryExtensions | |
{ | |
public static bool AddToList<KEYTYPE, VALUETYPE>(this Dictionary<KEYTYPE, List<VALUETYPE>> dictionary, KEYTYPE key, VALUETYPE value) | |
{ | |
bool isNew = false; | |
List<VALUETYPE> list; | |
if (!dictionary.TryGetValue(key, out 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 UnityEditor; | |
using System; | |
using System.Collections.Generic; | |
public class AssetSaveProcess : AssetModificationProcessor | |
{ | |
public static event Action OnSaveCurrentScene; | |
public static string[] OnWillSaveAssets (string[] paths) |
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
Shader "RadialTimer" { | |
Properties { | |
_Angle ("Angle", Range(0,180)) = 180 | |
_Color ("Color", Color) = (1,1,1,1) | |
_InnerRadius ("Inner Radius", Range(0,1)) = 0 | |
} | |
SubShader { | |
Tags | |
{ | |
"RenderType"="Transparent" |
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 VPainter : MonoBehaviour | |
{ | |
public MeshCollider[] paintTargets = new MeshCollider[0]; | |
public Color targetColor; | |
public float paintRadius = 1f; | |
public float paintSpeed = 1f; |
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; | |
public class MeshExporter | |
{ | |
const string menuItemPath = "Assets/Export Mesh Instance"; | |
[MenuItem(menuItemPath)] | |
public static void SaveMeshAsAsset () | |
{ |
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.Generic; | |
using System.Collections; | |
using System; | |
public class Trigger : MonoBehaviour | |
{ | |
public Action<Collider> onTriggerEnter; | |
public Action<Collider> onTriggerExit; | |