Skip to content

Instantly share code, notes, and snippets.

View anchan828's full-sized avatar

Keigo Ando anchan828

  • Unity Technologies
  • Japan
  • 11:10 (UTC +09:00)
  • X @kyusyukeigo
View GitHub Profile
Vector2 v2;
void OnGUI ()
{
v2 = EditorGUILayout.Vector2Field ("", v2);
EditorGUIUtility.SetIconSize (v2);
Debug.Log (EditorGUIUtility.GetIconSize ());
tex = (Texture2D)EditorGUI.ObjectField (new Rect (0, 50, 100, 100), tex, typeof(Texture2D));
GUI.Label (new Rect (0, 150, 100, 30), EditorGUIUtility.ObjectContent (tex, typeof(Texture2D)));
@anchan828
anchan828 / gist:2592717
Created May 4, 2012 06:57
NaClのpostMessageをWebPlayerのSendMessageっぽく
function GetUnity() {
return document.getElementById("UnityEmbed")
}
function SendMessage(name, method, parameter) {
GetUnity().postMessage(name + "." + method + "(" + parameter + ")")
}
using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour
{
long time = 5000;
void Start ()
{
AndroidJNI.AttachCurrentThread ();
using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour
{
void Start ()
{
MaterialPropertyBlock mpb = new MaterialPropertyBlock ();
//赤色の情報を加える
mpb.AddColor ("_Color", Color.red);
private static WWW www;
static UpdateCheck ()
{
www = new WWW ("URL");
EditorApplication.update += _Update;
}
private static void _Update ()
{
IEnumerator _CheckStart ()
{
WWW www = new WWW ("URL");
yield return www;
Debug.Log (www.text);
}
using UnityEngine;
using UnityEditor;
using System.Collections;
[InitializeOnLoad]
public class UpdateCheck : MonoBehaviour
{
static UpdateCheck ()
{
if (EditorApplication.timeSinceStartup < 10)
IEnumerator Start ()
{
particleSystem.Play ();
yield return new WaitForSeconds(3);
particleSystem.Stop ();
yield return new WaitForSeconds(3);
particleSystem.Play ();
//yield return new WaitForSeconds(3);
//particleSystem.Pause ();
//yield return new WaitForSeconds(3);
IEnumerator Start ()
{
particleSystem.Play ();
yield return new WaitForSeconds(3);
particleSystem.Stop ();
yield return new WaitForSeconds(3);
particleSystem.Play ();
yield return new WaitForSeconds(3);
particleSystem.Pause ();
yield return new WaitForSeconds(3);
using UnityEngine;
using System.Collections;
public class Script : MonoBehaviour
{
public int w = 100;
private Texture2D tex;
void Update ()
{