Skip to content

Instantly share code, notes, and snippets.

@enue
enue / Billboard.cs
Last active December 15, 2016 12:45
[Unity]Billboard
using UnityEngine;
using System.Collections;
namespace TSKT
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
[RequireComponent(typeof(Renderer))]
public class Billboard : MonoBehaviour
{
@enue
enue / TimeScaler.cs
Last active December 15, 2016 10:33
[Unity] TimeScaler
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity5.5.0p1
namespace TSKT
{
public class TimeScaler
{
@enue
enue / Vibrate.cs
Created December 13, 2016 22:12
[Unity]文字が震えるエフェクト
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
// Unity5.3.4p4
namespace TSKT
{
[RequireComponent(typeof(Text))]
@enue
enue / ResourceReferer.cs
Last active December 23, 2016 07:00
[Unity] Resourcesロードのパス指定を自動化する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity 5.5.0p3
namespace TSKT
{
public class ResourceReferer<T> : ScriptableObject
where T : Object
@enue
enue / SystemInfoMenu.cs
Last active November 4, 2016 02:50
【Unity】SystemInfoのプロパティを全取得して一覧する。
// Unity5.3.5p7
using UnityEngine;
using UnityEditor;
using System.Linq;
public class SystemInfoMenu
{
[MenuItem("TSKT/SystemInfo")]
static void PrintSystemInfo()
@enue
enue / ResourceLoader.cs
Last active November 4, 2016 02:28
【Unity】ResourceLoader
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity5.5.0b10
namespace TSKT
{
public class ResourceLoader<T> : CustomYieldInstruction
where T : UnityEngine.Object
@enue
enue / Sprite-HeightGradation.shader
Last active September 10, 2016 01:30
Spriteで高さフォグもどき
Shader "TSKT/Sprites/HeightGradation"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
_GradationColor("GradationColor", Color) = (0,0,0,1)
_GradationRange("GradationRange", Vector) = (10, -10, 0.0, 0.0)
}
@enue
enue / ImageTrimmer.cs
Created September 8, 2016 08:05
立ち絵の透明部分をトリミングする
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace TSKT
{
public class ImageTrimmer : AssetPostprocessor
{
static bool IsTarget(string path)
@enue
enue / ColorUtil.cs
Created August 29, 2016 21:43
argb parser
static public class ColorUtil
{
static public bool TryParseArgbString(string argb, out Color color)
{
if (ColorUtility.TryParseHtmlString(argb, out color))
{
var a = color.r;
color.r = color.g;
color.g = color.b;
color.b = color.a;
@enue
enue / EnumUtil.cs
Last active August 29, 2015 14:13
strings to flags attribute enum
static public class EnumUtil
{
static public T Parse<T>(IEnumerable<string> src)
where T : struct, IComparable, IFormattable, IConvertible
{
int value = 0;
foreach (var it in src)
{
value |= (int)System.Enum.Parse(typeof(T), it);
}