Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

setchi setchi

🏠
Working from home
View GitHub Profile
@setchi
setchi / CustomUnlitTransparentCutout.shader
Last active May 16, 2020
Unlit/Transparent Cutout をベースにしています
View CustomUnlitTransparentCutout.shader
// Unlit alpha-cutout shader.
// - no lighting
// - no lightmap support
// - no per-material color
Shader "Custom/Unlit/Transparent Cutout" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
View cloudSettings
{"lastUpload":"2020-06-05T10:23:25.465Z","extensionVersion":"v3.4.3"}
@setchi
setchi / UIBehaviourExtensions.cs
Created Jul 27, 2015
スクリプトからuGUIのEventTriggerへリスナー登録する拡張
View UIBehaviourExtensions.cs
// for uGUI(from 4.6)
#if !(UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5)
using UnityEngine.Events;
using UnityEngine.EventSystems;
public static partial class UIBehaviourExtensions
{
public static void AddListener(this UIBehaviour uiBehaviour, EventTriggerType eventID, UnityAction<BaseEventData> callback)
{
@setchi
setchi / ImageSlicer.cs
Last active Aug 29, 2015
画像を分割して個別に保存する
View ImageSlicer.cs
using UnityEngine;
using System.IO;
public class ImageSlicer : MonoBehaviour {
[SerializeField]
Texture2D texture;
[SerializeField]
int horizontalSlices;
@setchi
setchi / SingletonGameObject.cs
Last active Aug 29, 2015
Scene上に配置不要のシングルトンGameObject
View SingletonGameObject.cs
using UnityEngine;
using System.Collections;
public class SingletonGameObject<T> : MonoBehaviour where T : MonoBehaviour {
static T instance_;
public static T Instance {
get {
if (instance_ == null) {
instance_ = FindObjectOfType<T>();
}
@setchi
setchi / HTTP.cs
Last active Aug 29, 2015
UnityでHTTP通信するクラス
View HTTP.cs
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
public class HTTP : MonoBehaviour {
private static HTTP instance;
// Singleton
private HTTP () {}
You can’t perform that action at this time.