Skip to content

Instantly share code, notes, and snippets.

View Suzeep's full-sized avatar

Suzeep Suzeep

View GitHub Profile
@Suzeep
Suzeep / DefineSymbolSwitcher.cs
Last active November 18, 2017 09:25
DEBUG, RELEASE, MASTERといったプリプロセッサを追加・切り替えするメニュー
View DefineSymbolSwitcher.cs
using UnityEditor;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
//================================================================================
// class DefineSymbolSwitcher
//================================================================================
public static class DefineSymbolSwitcher
@Suzeep
Suzeep / settings.json
Last active June 20, 2017 03:52
VisualStudioCode - user setting (confirmed version 1.13.1)
View settings.json
// Place your settings in this file to overwrite the default settings
{
// Controls if the editor shows reference information for the modes that support it
"editor.referenceInfos": false,
// Controls if the editor will insert spaces for tabs. Accepted values: "auto", true, false. If set to "auto", the value will be guessed when a file is opened.
"editor.insertSpaces": false,
// エディターで空白文字を表示するかどうかを制御します
"editor.renderWhitespace": true,
@Suzeep
Suzeep / ExtensionsTransform.cs
Created January 19, 2017 14:00
UnityのTransformクラスの拡張メソッド
View ExtensionsTransform.cs
using UnityEngine;
//================================================================================
// class ExtensionsTransform
//================================================================================
public static class ExtensionsTransform
{
//--------------------------------------------------------------------------------
// set world position
//--------------------------------------------------------------------------------
@Suzeep
Suzeep / StringEditor.cs
Last active November 4, 2016 00:49
AdvancedInspectorでMultilineAttributeを指定したstringの配列・リストが属性反映されてないので無理やり反映させた。StringEditor.csを以下のように編集。
View StringEditor.cs
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
namespace AdvancedInspector
{
public class StringEditor : FieldEditor
{
public override Type[] EditedTypes
@Suzeep
Suzeep / UniUtil.cs
Last active November 12, 2019 16:39
Unity用の汎用メソッド集
View UniUtil.cs
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Linq;
//================================================================================
// Unity用 汎用ライブラリ
//================================================================================
@Suzeep
Suzeep / ProfileStats.cs
Last active May 26, 2017 07:36
FPS、メモリ使用量等を画面に表示するスクリプト(訂正版)。
View ProfileStats.cs
using UnityEngine;
using UnityEngine.Profiling;
using System.Collections;
using System.Text;
using System.Linq;
[ExecuteInEditMode()]
//=====================================================================================
//=====================================================================================
// class ProfileStats
@Suzeep
Suzeep / TransformList.cs
Created January 21, 2015 03:18
アタッチしたオブジェクトのTransformを全取得するスクリプト その2。
View TransformList.cs
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 / ShurikenEffectScale.cs
Created February 17, 2014 12:00
Shurikenの初期スケーリングの設定(モノによっては効かない物もある)
View ShurikenEffectScale.cs
using UnityEngine;
using System.Collections;
public class ShurikenEffectScale : MonoBehaviour
{
// Awake
void Awake()
{
// mul scale to particles
var particles = this.gameObject.GetComponentsInChildren<ParticleSystem>();
@Suzeep
Suzeep / SystemInstance.cs
Last active January 3, 2016 02:29
シングルトンクラスのオブジェクトを起動時に自動生成するスクリプト。
View SystemInstance.cs
using UnityEngine;
using System;
//=====================================================================================
// class SystemInstance
//=====================================================================================
public class SystemInstance : Singleton<SystemInstance>
{
//=====================================================================================
// constant
@Suzeep
Suzeep / Sample.cs
Last active December 27, 2015 03:09
カスタムインスペクタに配列を表示するサンプルコード。
View Sample.cs
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;
}