Skip to content

Instantly share code, notes, and snippets.

View anchan828's full-sized avatar

Keigo Ando anchan828

  • Unity Technologies
  • Japan
  • 04:28 (UTC +09:00)
  • X @kyusyukeigo
View GitHub Profile
@anchan828
anchan828 / C#
Created December 16, 2012 14:34
自分だけのPropertyDrawerを作ろう! ref: http://qiita.com/kyusyukeigo/items/8be4cdef97496a68a39d
using UnityEngine;
using System.Collections;
public class SampleScript : MonoBehaviour {
public float hp;
void Update()
{
Debug.Log( hp );
@anchan828
anchan828 / SceneAttribute.cs
Created December 10, 2012 16:36
インスペクターでシーン名をEnumで選択できるプロパティ拡張
using UnityEngine;
public class SceneAttribute : PropertyAttribute
{
public int selectedValue = 0;
public SceneAttribute ()
{
}
}
using UnityEngine;
/// <summary>
/// <para>通常使うスクリプトファイル。ゲームオブジェクトにアタッチすればインスペクターに表示される</para>
/// <para>今回は既にあるRangeAttributeを自作します。</para>
/// </summary>
public class Example : MonoBehaviour
{
/// <summary>
/// 0から10までしか設定することの出来ないスライダーを作成します。
/// <summary>
/// https://gist.github.com/4243887
/// http://anchan828.tumblr.com/post/37544410340
/// </summary>
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.Collections.Generic;
using System;
@anchan828
anchan828 / gist:4218328
Created December 5, 2012 18:42
ログをブラウザのコンソールに出す WebPlayer用
using UnityEngine;
public class DebugLog : MonoBehaviour
{
void Awake ()
{
if (Debug.isDebugBuild)
Application.RegisterLogCallback (Handle);
}
@anchan828
anchan828 / Example.cs
Created November 27, 2012 18:29
RichTextUtilityのExample
using UnityEngine;
public class Example : MonoBehaviour
{
void OnGUI ()
{
GUIStyle style = GUIStyle.none;
{
style.normal.textColor = Color.white;
style.richText = true;
GameObject cube = GameObject.Find ("cube");
if (cube == null) {
Debug.LogException (new NullReferenceException ());
}
cube.GetComponent<Hoge> ();
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}

#マークダウン表示テスト

です

##ほげほげ

テスト

@anchan828
anchan828 / unitygames-util-test.coffee
Created October 4, 2012 18:15
Jasmineで非同期テスト
describe "ゲーム取得", =>
@data = null
afterEach =>
@data =null
it "取得", =>
api.getGame(GAME_ID[0]).done (data) => @data = data
waitsFor =>
data
, "load..."