This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Example : MonoBehaviour | |
{ | |
void Start () | |
{ | |
MaterialPropertyBlock mpb = new MaterialPropertyBlock (); | |
//赤色の情報を加える | |
mpb.AddColor ("_Color", Color.red); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Example : MonoBehaviour | |
{ | |
long time = 5000; | |
void Start () | |
{ | |
AndroidJNI.AttachCurrentThread (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetUnity() { | |
return document.getElementById("UnityEmbed") | |
} | |
function SendMessage(name, method, parameter) { | |
GetUnity().postMessage(name + "." + method + "(" + parameter + ")") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instance ID: 2 Object's name: VertexLit | |
Instance ID: 4 Object's name: Legacy Shaders/Diffuse Fast | |
Instance ID: 6 Object's name: Diffuse | |
Instance ID: 8 Object's name: Bumped Diffuse | |
Instance ID: 10 Object's name: Specular | |
Instance ID: 12 Object's name: Bumped Specular | |
Instance ID: 14 Object's name: Diffuse Detail | |
Instance ID: 16 Object's name: Self-Illumin/VertexLit | |
Instance ID: 18 Object's name: Self-Illumin/Diffuse | |
Instance ID: 20 Object's name: Self-Illumin/Bumped Diffuse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Rect rect1, rect2; | |
private bool stats, gizmos, on; | |
void OnGUI (){ | |
on = EditorGUILayout.Toggle (on); | |
rect1 = EditorGUILayout.RectField (rect1); | |
rect2 = new Rect (0, 22, position.width, position.height); | |
stats = EditorGUILayout.Toggle ("stats :", stats); | |
gizmos = EditorGUILayout.Toggle ("gizmos :", gizmos); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class RenderGameViewCamerasScript : EditorWindow | |
{ | |
[MenuItem("EditorGUIUtility/RenderGameViewCameras")] | |
static void OpenWindow () | |
{ | |
RenderGameViewCamerasScript window = GetWindow<RenderGameViewCamerasScript> (); | |
window.position = new Rect (50, 50, 500, 500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MacBook Pro | |
13-inch, Early 2011 | |
プロセッサ 2.3 GHz Intel Core i5 | |
メモリ 8 GB 1333 MHz DDR3 | |
グラフィックス Intel HD Graphics 3000 512 MB | |
ソフトウェア Mac OS X Lion 10.7.3(11D50d) | |
Parallels | |
バージョン: 7.0.15098.770637 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class Delay : Editor | |
{ | |
[MenuItem("EditorApplication/StartDelayCall")] | |
static void StartDelay () | |
{ | |
EditorApplication.delayCall += CallMethod; | |
Debug.Log (EditorApplication.timeSinceStartup); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#gameData :file").change(function (e) { | |
var file = e.target.files[0]; | |
var reader = new FileReader(); | |
reader.onload = function (load) { | |
var uni = load.target.result; | |
uni = uni.replace("data:base64", "data:application/vnd.unity;base64") | |
unityObject.embedUnity("unityPlayer",uni, 600,450); |