Skip to content

Instantly share code, notes, and snippets.

Tatsuhiko Yamamura tsubaki

Block or report user

Report or block tsubaki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tsubaki
tsubaki / Sprites Default Front
Created Aug 28, 2015
Zテストを無視するスプライトシェーダー
View Sprites Default Front
Shader "Sprites/Default Front"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
}
SubShader
@tsubaki
tsubaki / SingletonObject.cs
Last active Aug 29, 2015
オブジェクト単位でのシングルトン。名前で判断
View SingletonObject.cs
using UnityEngine;
using System.Collections;
/// <summary>
/// このコンポーネントがアタッチされているオブジェクトは、 単一のオブジェクトに含まれる
/// 既にある場は削除される
/// </summary>
public class SingletonObject : MonoBehaviour
{
/// <summary>
@tsubaki
tsubaki / TransformExtension.cs
Created Mar 7, 2014
シーン内のルートオブジェクトを取得するメソッドをtransformに追加する
View TransformExtension.cs
using UnityEngine;
using System.Collections;
using System;
public static class TransformExtension
{
public static GameObject[] FindRootObject (this Transform transform)
{
return Array.FindAll (GameObject.FindObjectsOfType<GameObject> (), (item) => item.transform.parent == null);
}
@tsubaki
tsubaki / DataSet.cs
Created Mar 8, 2014
【試作】変更通知ディクショナリと、シングルトンなデータ管理クラス
View DataSet.cs
using UnityEngine;
using System.Collections;
public class DataSet : SingletonMonoBehaviour<DataSet> {
public ObserverDictionary<bool> notiBool = new ObserverDictionary<bool>();
public ObserverDictionary<int> notiInt = new ObserverDictionary<int>();
public static void Attatch(string key, ObserverDictionary<bool>.NotificationAction action)
{
@tsubaki
tsubaki / EasyAnchor.cs
Created Mar 17, 2014
maincameraから見た左上・右下等にゲームオブジェクトを移動する。左上を(0,0)にしたい場合等
View EasyAnchor.cs
using UnityEngine;
using System.Collections;
public class EasyAnchor : MonoBehaviour
{
public enum VerticalPosition
{
Top = 2,
Center = 1,
Bottom = 0
@tsubaki
tsubaki / FindReference.cs
Last active Aug 29, 2015
選択したオブジェクトを参照しているシーン内のオブジェクト一覧を表示する
View FindReference.cs
using UnityEngine;
using System.Collections;
using UnityEditor;
public class FindReference
{
[MenuItem("GameObject/FindReferenceInSceneObject")]
static void Find ()
{
@tsubaki
tsubaki / RendererTest.cs
Created Apr 16, 2014
子オブジェクトの表示を一気に消す
View RendererTest.cs
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class RenderTest : MonoBehaviour
{
void OnEnable ()
{
var rendererList = GetComponentsInChildren<Renderer> ();
foreach (var renderer in rendererList) {
@tsubaki
tsubaki / FreezRigidbody.cs
Last active Aug 29, 2015
rigidbodyをkinematicにする例(別コンポーネントとの連携)
View FreezRigidbody.cs
using UnityEngine;
using System.Collections;
public class FreezRigidbody : MonoBehaviour
{
Rigidbody _rigidbody;
// 定義しておくとコンポーネント起動時に1回呼ばれるイベント。詳しくはMonoBehaviour参照
void Start ()
{
@tsubaki
tsubaki / HideObjectManager.cs
Created Apr 23, 2014
ヒエラルキーから選択したオブジェクトを消す
View HideObjectManager.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class HideObjectManager : MonoBehaviour
{
#if UNITY_EDITOR
public List<GameObject> hideObjectList = new List<GameObject> ();
@tsubaki
tsubaki / GetRootInstancePrepared.cs
Last active Aug 29, 2015
ルートオブジェクト一覧を取得する
View GetRootInstancePrepared.cs
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class GetRootInstancePrepared : MonoBehaviour {
You can’t perform that action at this time.