Skip to content

Instantly share code, notes, and snippets.

@enue
enue / chars
Last active October 2, 2022 10:05
ゲームに使いそうな文字セット
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]_abcdefghijklmnopqrstuvwxyz{|}~
あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゐゆゑよらりるれろわをん
ぁぃぅぇぉゃゅょっ
がぎぐげござじずぜぞだぢづでどばびぶべぼ
ぱぴぷぺぽ
アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン
ァィゥェォャュョッ
ガギグゲゴザジズゼゾダヂヅデドバビブベボ
パピプペポ
@enue
enue / screenshot.cs
Last active August 29, 2015 14:07
スクショセーブ機能
using UnityEngine;
using System.Collections;
using System.IO;
public class Screenshot : MonoBehaviour
{
[SerializeField]
KeyCode key = KeyCode.Space;
void Update()
@enue
enue / Sprites-NonDirectijonalLight.shader
Created November 16, 2014 02:38
法線無視照明スプライト
Shader "Sprites/NonDirectionalLight"
{
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
}
SubShader {
Tags {
@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);
}
@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 / 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 / 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 / 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 / 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 / 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