Skip to content

Instantly share code, notes, and snippets.

View setchi's full-sized avatar
🏠
Working from home

setchi setchi

🏠
Working from home
View GitHub Profile
@setchi
setchi / HTTP.cs
Last active August 29, 2015 14:14
UnityでHTTP通信するクラス
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
public class HTTP : MonoBehaviour {
private static HTTP instance;
// Singleton
private HTTP () {}
@setchi
setchi / SingletonGameObject.cs
Last active August 29, 2015 14:14
Scene上に配置不要のシングルトンGameObject
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 / ImageSlicer.cs
Last active August 29, 2015 14:16
画像を分割して個別に保存する
using UnityEngine;
using System.IO;
public class ImageSlicer : MonoBehaviour {
[SerializeField]
Texture2D texture;
[SerializeField]
int horizontalSlices;
@setchi
setchi / UIBehaviourExtensions.cs
Created July 27, 2015 13:36
スクリプトからuGUIのEventTriggerへリスナー登録する拡張
// 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)
{
{"lastUpload":"2020-08-24T04:58:48.851Z","extensionVersion":"v3.4.3"}
@setchi
setchi / CustomUnlitTransparentCutout.shader
Last active February 5, 2022 05:18
Unlit/Transparent Cutout をベースにしています
// 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
}