Skip to content

Instantly share code, notes, and snippets.

View tarukosu's full-sized avatar

tarukosu tarukosu

View GitHub Profile
@tarukosu
tarukosu / FlowTextLoader.cs
Created July 30, 2020 01:37
Bolt フローの動的ロード
using Bolt;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using YamlDotNet.RepresentationModel;
public class FlowTextLoader : MonoBehaviour
{
@tarukosu
tarukosu / BrowserLauncher.cs
Created July 21, 2020 08:45
Launch browser from HoloLens Unity app
using UnityEngine;
#if WINDOWS_UWP
using System;
using Windows.System;
#endif
public static class BrowserLauncher
{
public static void Launch(string url, bool useHoloBrowser = false)
@tarukosu
tarukosu / PublishingSettingsUpdater.cs
Created July 6, 2020 13:10
アプリのパッケージ名にプロダクト名を自動設定するスクリプト
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Build;
using UnityEngine;
namespace ProjectSettingsUtilities
{
[InitializeOnLoad]
public class PublishingSettingsUpdater : IActiveBuildTargetChanged
{
@tarukosu
tarukosu / Offer SDP
Created July 10, 2019 12:11
Offer SDP
v=0
o=- 5512830869395964291 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127 123 125 122 124
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:fgga
@tarukosu
tarukosu / BoundingBoxSample.cs
Created May 22, 2019 01:18
BoxCollider の Edit Collider のような UI
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class BoundingBoxSample : MonoBehaviour
{
public Vector3 BoundingBoxCenter;
public Vector3 BoundingBoxSize;
@tarukosu
tarukosu / Ubuntu 初期セットアップ
Last active April 10, 2019 02:47
Ubuntu 初期セットアップ
# バージョン
- Ubuntu 16.04
# パッケージのアップデート
```
sudo apt update
sudo apt upgrade
```
class GreeterImpl : Greeter.GreeterBase
{
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
{
return Task.FromResult(new HelloReply { Message = "Hello " + request.Name });
}
}
Channel channel = new Channel("127.0.0.1:10051", ChannelCredentials.Insecure);
var client = new Greeter.GreeterClient(channel);
String user = "you";
var reply = client.SayHello(new HelloRequest { Name = user });
Console.WriteLine("Greeting: " + reply.Message);
@tarukosu
tarukosu / cameraToWorld.cs
Last active November 30, 2022 17:40
HoloLens カメラ座標から世界座標への変換
void OnPhotoCaptured(PhotoCapture.PhotoCaptureResult result, PhotoCaptureFrame photoCaptureFrame)
{
Matrix4x4 cameraToWorldMatrix;
photoCaptureFrame.TryGetCameraToWorldMatrix(out cameraToWorldMatrix);
Matrix4x4 projectionMatrix;
photoCaptureFrame.TryGetProjectionMatrix(out projectionMatrix);
var imagePosZeroToOne = new Vector2(pixelPos.x / imageWidth, 1 - (pixelPos.y / imageHeight));
var imagePosProjected = (imagePosZeroToOne * 2) - new Vector2(1, 1); // -1 to 1 space
@tarukosu
tarukosu / .gitconfig
Last active April 6, 2018 03:03
.gitconfig
[core]
pager = less -cm
quotepath = false
[user]
name = Furuta Yusuke
email = 4415085+tarukosu@users.noreply.github.com
[alias]
# いい感じのグラフでログを表示