Skip to content

Instantly share code, notes, and snippets.

View asus4's full-sized avatar
:octocat:
Working from home

Koki Ibukuro asus4

:octocat:
Working from home
View GitHub Profile
@asus4
asus4 / TouchToMouseConverter.cs
Last active September 29, 2015 21:57
TouchEvent to MouseEvent for Unity
/**
Converts Mobile Touch to the default Mouse Click
## invoked these method in Mobile too
OnMouseDown
OnMouseDrag
OnMouseUp
## only called in touch screen
@asus4
asus4 / getUrlVars.js
Created February 12, 2012 14:38
getUrlVars
function getUrlVars() {
var vars = [],
hash,
i,
hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
@asus4
asus4 / GestureListener.cs
Created February 28, 2012 05:31
delegate Tap, Drag, Swipe
using UnityEngine;
using System.Collections;
// 3 types delegates
public delegate void TapDelegate();
public delegate void DragDelegate(Vector3 vec);
public delegate void SwipeDelegate(SwipeDirection direction);
public enum SwipeDirection {
@asus4
asus4 / GameObjectUtil.cs
Created February 29, 2012 13:43
make a plane from 2^x size image, ***need EzGUI***
using UnityEngine;
using System.Collections;
// /////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// ゲームオブジェクトのユーティリティ
//
// /////////////////////////////////////////////////////////////////////////////////////////////////////////
public class GameObjectUtil {
@asus4
asus4 / UIPopup.cs
Created March 1, 2012 04:52
Popup script for Unity3D (using EzGUI, iTween)
using UnityEngine;
using System.Collections;
// delegates
public enum UIPopupState {
SUBMIT,
CANCEL
}
public delegate void ClickDelegate(UIPopupState state);
@asus4
asus4 / uniq_char.py
Created March 12, 2012 08:52
Export unique char from unicode text file. for Unity
#!/usr/bin/python
# coding: utf-8
import codecs,sys
"""
convert text to uniq characters
for Unity
ex:
@asus4
asus4 / UISystemFont.cs
Created March 28, 2012 02:37
SystemFontRenderer utility for nGUI
using UnityEngine;
using System.Collections;
//[ExecuteInEditMode]
[RequireComponent(typeof(SystemFontRenderer))]
[AddComponentMenu("NGUI/Interaction/Ex/System Font")]
public class UISystemFont : MonoBehaviour {
SystemFontRenderer fontRenderer;
using UnityEngine;
using System;
using System.Collections;
using System.IO;
/// <summary>
/// Defalult WWW.LoadFromCacheOrDownload() can use only AssetBundle
/// this eneble chaching any file.
/// </summary>
public class WWWCache {
@asus4
asus4 / UIPopup.cs
Created April 6, 2012 04:46
Popup for nGUI,Unity3D
using UnityEngine;
using System.Collections;
// delegates
public enum UIPopupState {
SUBMIT,
CANCEL
}
public delegate void ClickDelegate(UIPopupState state);
@asus4
asus4 / DownloadManager.cs
Created April 25, 2012 14:32
Unity DownloadManager
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/**
DownloadManager
@author koki ibukuro
*/
public class DownloadManager : MonoBehaviour , System.IDisposable {
// using classes