Skip to content

Instantly share code, notes, and snippets.

View Suzeep's full-sized avatar

Suzeep Suzeep

View GitHub Profile
@Suzeep
Suzeep / Singleton.cs
Last active December 24, 2015 05:09
Unityでのシングルトンクラス。
using UnityEngine;
using System.Collections;
//=====================================================================================
// シングルトン
//=====================================================================================
public abstract class Singleton<T> : MonoBehaviour where T : Singleton<T>
{
//-------------------------------------------------------------------------------------
// インスタンス取得
@Suzeep
Suzeep / ProfileStats.cs
Last active December 24, 2015 11:18
FPS、メモリ使用量等を画面に表示するスクリプト。
using UnityEngine;
using System.Collections;
using System.Text;
using System.Linq;
[ExecuteInEditMode()]
public class ProfileStats : MonoBehaviour
{
//------------------------------------------------------------
@Suzeep
Suzeep / TransformList.cs
Created October 3, 2013 12:16
アタッチしたオブジェクトのTransformを全取得するスクリプト。
using UnityEngine;
using System;
using System.Collections.Generic;
//----------------------------------------------------------------------
//
// アタッチしたオブジェクト以下のTransformを全取得するスクリプト
// 主にキャラクターの関節取得用
//
// ※
@Suzeep
Suzeep / SpicyTest.cs
Created October 26, 2013 14:39
Spicy Pixel のConcurrency Kitを使ったサンプルコード。
using UnityEngine;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using SpicyPixel.Threading;
using SpicyPixel.Threading.Tasks;
public class SpicyTest : ConcurrentBehaviour
{
// Awake
@Suzeep
Suzeep / Sample.cs
Last active December 27, 2015 03:09
カスタムインスペクタに配列を表示するサンプルコード。
using UnityEngine;
using System.Collections;
public class Sample : MonoBehaviour
{
// member
public int m_Count;
public int[] m_CountArray = new int[ 4 ];
public float m_DeltaTime;
}
@Suzeep
Suzeep / SystemInstance.cs
Last active January 3, 2016 02:29
シングルトンクラスのオブジェクトを起動時に自動生成するスクリプト。
using UnityEngine;
using System;
//=====================================================================================
// class SystemInstance
//=====================================================================================
public class SystemInstance : Singleton<SystemInstance>
{
//=====================================================================================
// constant
@Suzeep
Suzeep / ShurikenEffectScale.cs
Created February 17, 2014 12:00
Shurikenの初期スケーリングの設定(モノによっては効かない物もある)
using UnityEngine;
using System.Collections;
public class ShurikenEffectScale : MonoBehaviour
{
// Awake
void Awake()
{
// mul scale to particles
var particles = this.gameObject.GetComponentsInChildren<ParticleSystem>();
@Suzeep
Suzeep / TransformList.cs
Created January 21, 2015 03:18
アタッチしたオブジェクトのTransformを全取得するスクリプト その2。
using UnityEngine;
using System.Collections.Generic;
public class TransformList : MonoBehaviour
{
// Start
void Start()
{
Transform[] obj_list = this.GetComponentsInChildren<Transform>();
for( int i=0; i < obj_list.Length; ++i ){
@Suzeep
Suzeep / ProfileStats.cs
Last active May 26, 2017 07:36
FPS、メモリ使用量等を画面に表示するスクリプト(訂正版)。
using UnityEngine;
using UnityEngine.Profiling;
using System.Collections;
using System.Text;
using System.Linq;
[ExecuteInEditMode()]
//=====================================================================================
//=====================================================================================
// class ProfileStats
@Suzeep
Suzeep / UniUtil.cs
Last active November 12, 2019 16:39
Unity用の汎用メソッド集
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Linq;
//================================================================================
// Unity用 汎用ライブラリ
//================================================================================