Skip to content

Instantly share code, notes, and snippets.

View anchan828's full-sized avatar

Keigo Ando anchan828

View GitHub Profile
using UnityEngine;
public class Test : MonoBehaviour
{
//targetB
private Plane plane;
public Transform targetA;
void Start ()
using UnityEngine;
public class Example : MonoBehaviour
{
static Example _instance;
void Awake ()
{
if (_instance != null) {
Destroy (gameObject);
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour
{
public GUIStyle Btn;
void OnGUI ()
{
@anchan828
anchan828 / gist:3807207
Created September 30, 2012 15:39
WindowsでEditorPrefsを使うときにはBase64で保存する
using UnityEngine;
using UnityEditor;
using System.Text;
public class NewBehaviourScript{
[MenuItem("Window/Save")]
static void Save (){
EditorPrefs.SetString ("Hoge", ToBase64 ("日本語"));
}
@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..."

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

です

##ほげほげ

テスト

using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
GameObject cube = GameObject.Find ("cube");
if (cube == null) {
Debug.LogException (new NullReferenceException ());
}
cube.GetComponent<Hoge> ();
@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;
@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);
}