/* * HoloLensの向いている方向と自己位置をJsonSelfLocationの形式で渡すメソッド */ public JsonSelfLocation getSelfLocation() { var theta = degree(Math.Atan2(camera.transform.forward.x, camera.transform.forward.z)); JsonSelfLocation l = new JsonSelfLocation(theta + cordinateGap.gapAngle, getCurrentLocationOnPullDogCordinates()); return(l); }
/* * AndroidにJSONに成形したデータを渡すメソッド * データ型はJSONStructureを参照のこと */ public void sendMessageToAndroid(JsonSelfLocation jsl, JsonMessage message) { JsonDataFromHoloLens jdfh = new JsonDataFromHoloLens(jsl, message); string json = JsonConvert.SerializeObject(jdfh); #if UNITY_UWP sendMessage(json); #endif }
public JsonDataFromHoloLens(JsonSelfLocation jsl, JsonMessage jm) { selfLocation = jsl; message = jm; }