This file contains hidden or 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; | |
using System.IO; | |
using System.Xml; | |
using System.Xml.Serialization; | |
// 保存したい構造体 | |
[System.Serializable] | |
public struct Param |
This file contains hidden or 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 SetPositionY : MonoBehaviour { | |
void Start () { | |
// スタート時のワールド座標での位置を取得 | |
Vector3 pos = transform.position; | |
// 位置からTerrain上の高さを取得 |
This file contains hidden or 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
#!ruby -Ku | |
# Google Glass へメッセージ通知 (Mirror API) | |
# by GOROman | |
require 'net/http' | |
require 'json' | |
# OAuthで得たトークン | |
TOKEN = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
API = 'https://www.googleapis.com/mirror/v1/timeline' |
This file contains hidden or 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
// https://github.com/r1pper/GoPro.Hero を使用 | |
using System; | |
using GoPro.Hero; | |
using GoPro.Hero.Hero3; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ |
This file contains hidden or 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
#!ruby -Ku | |
# Wifi接続したGoProをRubyから制御するサンプル | |
# by GOROman | |
require 'net/http' | |
class GoProControl | |
def initialize( host ) | |
@http = Net::HTTP.new( host ) |
This file contains hidden or 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
echo off | |
netsh WLAN connect name="GoProHero1" ssid="GoProHero1" | |
pause | |
netsh WLAN connect name="GoProHero2" ssid="GoProHero2" | |
pause | |
netsh WLAN connect name="GoProHero3" ssid="GoProHero3" |
This file contains hidden or 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
void SetAndroidVolume( int volume ) | |
{ | |
#if (UNITY_ANDROID && !UNITY_EDITOR) | |
int STREAM_MUSIC = 3; // Constant Value: 3 (0x00000003) | |
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
AndroidJavaObject ac = jc.GetStatic<AndroidJavaObject>("currentActivity"); | |
AndroidJavaObject am = ac.Call<AndroidJavaObject>("getSystemService", "audio"); | |
am.Call("setStreamVolume", STREAM_MUSIC, volume, 0); |
This file contains hidden or 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
// UnityからAndroidのCamera LEDを制御する例 | |
// startPreview() でカメラのプレビューを開始した状態で LEDOn() で光る | |
public class AndroidCamera { | |
AndroidJavaObject camera = null; | |
public AndroidCamera() { | |
WebCamDevice[] devices = WebCamTexture.devices; | |
Debug.Log("Camera Name:"+devices[0].name); |
This file contains hidden or 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
// AndroidManifest.xml に <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> の設定が必要 | |
string GetSSID() | |
{ | |
string ssid = "N/A"; | |
using (var activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity")) { | |
var wifiManager = activity.Call<AndroidJavaObject>("getSystemService", "wifi"); | |
ssid = wifiManager.Call<AndroidJavaObject>("getConnectionInfo").Call<string>("getSSID"); | |
} |
This file contains hidden or 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
require 'net/http' | |
HOST = '192.168.1.1' | |
PORT = 80 | |
Net::HTTP.start(HOST, PORT) do |http| | |
req = Net::HTTP::Post.new '/osc/commands/execute' | |
req.body = <<EOF | |
{ |