Skip to content

Instantly share code, notes, and snippets.

@Mesidin
Mesidin / Camera2DFollow.cs
Created January 13, 2016 14:55 — forked from ashblue/Camera2DFollow.cs
Camera 2D follow
using UnityEngine;
using System.Collections;
namespace Adnc.Cam {
public class Camera2DFollow : MonoBehaviour {
Vector3 currentVelocity; // Velocity used for damping camera movement
[Tooltip("Draws debug lines representing the camera's move logic (easing only)")]
[SerializeField] bool debug;
@Mesidin
Mesidin / RestoreScriptableObject.cs
Created January 13, 2016 14:53 — forked from ashblue/RestoreScriptableObject.cs
Save and restore a scriptable object reference after your custom editor windows have been re-compiled.
using UnityEngine;
using UnityEditor;
public static class Wm {
const string DATABASE_ID_KEY = "MyCustomDatabase";
public static MyScriptableObject _db;
public static MyScriptableObject Db {
get {
if (_db == null && EditorPrefs.HasKey(DATABASE_ID_KEY)) {
_db = GetDatabaseFromStorage();
@Mesidin
Mesidin / Backup.bat
Created November 30, 2015 16:52
Simple 7-Zip based backup script
@echo off
REM # Send To Backup Script
REM # Author - Matt Little (http://matthewjlittle.com)
REM # Adam Caudill (http://adamcaudill.com)
REM #
REM # To install:
REM #
REM # (windows 7):
REM # Goto Start->Run. Type in shell:sendto
Shader "Custom/Gamma Image Effect" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_SaturationAmount ("Saturation Amount", Range(0.0, 1.0)) = 1.0
_BrightnessAmount ("Brightness Amount", Range(0.0, 1.0)) = 1.0
_ContrastAmount ("Contrast Amount", Range(0.0,1.0)) = 1.0
}
SubShader
{
@Mesidin
Mesidin / BuildRadiator.cs
Created October 26, 2015 18:37 — forked from radiatoryang/BuildRadiator.cs
This is my Unity Editor build script that I use for my games, to automatically build out players and package them in ZIP files.
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.Compression;
using Ionic.Zip; // this uses the Unity port of DotNetZip https://github.com/r2d2rigo/dotnetzip-for-unity
@Mesidin
Mesidin / EditorWindowExample.cs
Last active September 22, 2015 06:30 — forked from AngryAnt/EditorWindowExample.cs
EditorWindowExample from the Unity Asia Bootcamp 12 talk "Streamlining your Unity editor". A simple node based editor.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
public class EditorWindowExample : EditorWindow
{
List<Node> nodes = new List<Node> ();
@Mesidin
Mesidin / SameInspector.cs
Last active September 19, 2015 07:07 — forked from tsubaki/SameInspector.cs
値やプロパティでプロパティを検索し、更新する
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Linq;
using System.Collections.Generic;
public class SameInspector : EditorWindow
{
string searchParameter = string.Empty;
string searchType = string.Empty;
@Mesidin
Mesidin / ExportLightprobe.cs
Last active September 19, 2015 07:07 — forked from tsubaki/ExportLightprobe.cs
LightProbeをシーンから出力する
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
public class ExportLightprobe
{
[MenuItem("Export/Export LightProbe")]
static void Export()
{
@Mesidin
Mesidin / LoadLightmap.cs
Last active September 19, 2015 07:07 — forked from tsubaki/LoadLightmap.cs
ライトマップ回りを読み込む
using UnityEngine;
using System.Collections;
public class LoadLightmap : MonoBehaviour {
[SerializeField] Texture2D[] light, dir;
[SerializeField] LightProbes lightprobes;
[SerializeField] Cubemap cubemap;
// Use this for initialization
void Start () {
@Mesidin
Mesidin / CreateAssetBundle.cs
Last active September 19, 2015 07:07 — forked from tsubaki/CreateAssetBundle.cs
AssetBundleをStreamingAssetsに出力する
using UnityEngine;
using System.Collections;
using UnityEditor;
public class CreateAssetBundle {
[MenuItem("Export/AssetBundleST")]
static void Export()
{
System.IO.Directory.CreateDirectory (Application.streamingAssetsPath);