Skip to content

Instantly share code, notes, and snippets.

View shundroid's full-sized avatar
🏠
Working from home

shundroid

🏠
Working from home
View GitHub Profile
[blogcard url="http://google.com"]
using UnityEngine;
public class RTransform : MonoBehaviour {
[SerializeField]
int offsetMaxX, offsetMinX, offsetMaxY, offsetMinY;
// Use this for initialization
void Start () {
}
using System;
using System.Reflection;
// 省略
void changeComponentField() {
string gameObjectName = "GameObject1"; // GameObjectの名前
string componentName = "ReflectionTest"; // GameObject内のComponentの名前
string fieldName = "field1"; // Component内のFieldの名前
string fieldVal = "hello!"; // Fieldに適用する名前
class ReflectionTest : MonoBehaviour
{
public string field1 = "";
}
// 属性を追加
[AttributeUsage(AttributeTargets.Field)]
public class PermitReflectionAttribute : Attribute
{
}
class ReflectionTest : MonoBehaviour
{
[PermitReflection]
public string field1 = "";
}
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2016-02-21 14:35:40" build="160219">
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Shells::cmd}"/>
<value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/>
var sphero = require("sphero");
var orb = sphero("COM7"); // 自分の Sphero の ID に置き換える
orb.connect(function() {
function setSpheroTimeout(fn, time) {
setTimeout(function() {
orb.ping(function() {
fn();
});
}, time);
// 読み込むとき、ES6 ( + browserify) だと便利
import Rx from "rx"; // ES6 modules
var images = ["1.png", "2.png", "3.png"];
function loadImages() {
return Rx.Observable.create(loadImagesObservable);
}
function loadImagesObservable(observer) {
var index = 0;
var loadImage = (name) => {