Skip to content

Instantly share code, notes, and snippets.

@tapuo
tapuo / eventAlias
Last active December 16, 2015 22:28
イベントのエイリアス作成 rgss for tkool xp
#--------------------------------------------------------------------------
# ● 同位置のイベント起動判定
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers)
result = false
# イベント実行中の場合
if $game_system.map_interpreter.running?
return result
end
# 全イベントのループ
@tapuo
tapuo / pause.boo
Created December 18, 2012 06:44 — forked from anonymous/pause.boo
def _Sleep(duration as single) as IEnumerator:
while duration > 0.0F:
unless pause:
duration -= Time.deltaTime
yield
def Sleep(duration as single) as Coroutine:
return StartCoroutine(_Sleep(duration))
def _Sleep() as IEnumerator:
@tapuo
tapuo / Vibration.boo
Created December 11, 2012 12:39
vibration for unity android
import UnityEngine
class Vibration(MonoBehaviour):
private viblator as AndroidJavaObject
def Start():
unityPlayer as AndroidJavaClass = AndroidJavaClass("com.unity3d.player.UnityPlayer")
currentActivity as AndroidJavaObject = unityPlayer.GetStatic[of AndroidJavaObject]("currentActivity")
viblator = currentActivity.Call[of AndroidJavaObject]("getSystemService","vibrator")
@tapuo
tapuo / ColImport.boo
Created December 1, 2012 08:47
fbx2mesh
import UnityEngine
import UnityEditor
class ColImport(AssetPostprocessor):
def OnPreprocessModel():
target as ModelImporter = assetImporter
if assetPath.Contains("colliderSrc"):
target.globalScale = 1.0F
target.normalImportMode = ModelImporterTangentSpaceMode.None
@tapuo
tapuo / ObjectCache.boo
Created July 18, 2012 21:05
unity object cache
import UnityEngine
static class ObjectCache(MonoBehaviour):
public pool as Hash = {}
public target as Hash = {}
#
def OCInstantiate(obj as GameObject, pos as Vector3, rot as Quaternion):
name as string = obj.name
if ObjectCache.pool[name] == null:
ObjectCache.target[name] = obj
@tapuo
tapuo / Sound.boo
Created June 25, 2012 00:51
Sound manager for Unity3D
import UnityEngine
import System.Collections
class Sound (MonoBehaviour):
public soundObject as GameObject # It have only AudioSource component.
#
public seTable as (AudioClip)
public bgmTable as (AudioClip)
#
private seIndex as Hash = {}
@tapuo
tapuo / rigPoint.ms
Created May 8, 2012 19:45
create FKRIG for 3DSMAX
-- 操作用point作成
mapped fn rigPoint x = (
p = x.pos + x.transform.row1 * x.length
b = point pos:p size:10
r = x.rotation
coordsys local (
b.rotation = r
rotate b (angleaxis 90 [0,1,0])
)
b.boneEnable=true
@tapuo
tapuo / buBonerotmanip.ms
Created May 8, 2012 19:42
manipulator plugin for 3DSMAX
plugin simpleManipulator bonerotManip
name:"bonerot"
invisible:true
(
local oldM
on canManipulateNode t return classof t == Point and classof t.parent == BoneGeometry
on updateGizmos do (