Skip to content

Instantly share code, notes, and snippets.

View OhkuboSGMS's full-sized avatar
🐈
LLM Cat

OkuboSGMS OhkuboSGMS

🐈
LLM Cat
View GitHub Profile
String version = null;
try {
BufferedReader br = new BufferedReader(new FileReader("/proc/version"));
version = br.readLine();
} catch (FileNotFoundException fex) {
Log.e("tag", fex.toString());
} catch (IOException iex) {
Log.e("tag",iex.toString());
@OhkuboSGMS
OhkuboSGMS / YoutubeLiveCommentFetcher.cs
Created July 17, 2018 06:13
Youtube Live Streaming APIのコメント取得をUniTask を使用して書き直し
using System;
using System.Collections;
using MiniJSON;
using UniRx.Async;
using UnityEngine;
using UnityEngine.Networking;
namespace VirtualComment
{
/// <summary>
@OhkuboSGMS
OhkuboSGMS / DummyString.cs
Created July 21, 2018 09:24
適当に英字を生成(using LINQ)
using System.Linq;
using Random = UnityEngine.Random;
public class DummyString
{
public static string Generate(int length)
{
return new string(Enumerable.Range(0, length).Select(i => Generate()).ToArray());
}
@OhkuboSGMS
OhkuboSGMS / EyeStone.cs
Created November 11, 2018 12:52
RectTransformUtility.ScreenPointToLocalPointInRectangleではまった
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace EscapeRoom.LogicImplement
{
public class EyeStone : Selectable ,IDragHandler
{
public Item Item;
@OhkuboSGMS
OhkuboSGMS / UploadTest.cs
Created January 12, 2019 18:47
OAuthの事前認証のためのスクリプト
using System.Collections;
public class UploadTest : UnityEngine.MonoBehaviour
{
private void Start()
{
StartCoroutine(Upload());
}
IEnumerator Upload()
@OhkuboSGMS
OhkuboSGMS / UploadAPKAfterBuildFinish.cs
Created January 12, 2019 19:13
ビルド後にApkをGoogle Driveにアップロードする
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
/// <summary>
/// require -> https://github.com/Elringus/UnityGoogleDrive
/// </summary>
public class UploadAPKAfterBuildFinish
@OhkuboSGMS
OhkuboSGMS / EventTriggerUtil.cs
Created March 11, 2019 05:44
Unity EventTriggerの拡張関数
using System.Collections.Generic;
using UnityEngine.Events;
using UnityEngine.EventSystems;
namespace EscapeRoom
{
public static class EventTriggerUtil
{
/// <summary>
/// EventTriggerにコールバック関数を登録する拡張関数
@OhkuboSGMS
OhkuboSGMS / RatioScale.cs
Created April 13, 2019 07:10
Support Portrait Aspect ration of 1:2 or more Device Change m_MatchWidthOrHeight of CanvasScaler
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
public class RatioScale : CanvasScaler
{
// Use this for initialization
void Start()
@OhkuboSGMS
OhkuboSGMS / SlackNotificationOnBuildFinish.cs
Created April 15, 2019 11:21
SlackにBuild通知を投げる tokenにアプリのtokenを設定する
using System;
using System.Collections;
using System.Text;
using Unity.EditorCoroutines.Editor;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
using UnityEngine.Networking;
namespace BuildProcess
const Installer = function(root) {
let promptEvent;
const install = function(e) {
if(promptEvent) {
promptEvent.prompt();
promptEvent.userChoice
.then(function(choiceResult) {
// The user actioned the prompt (good or bad).
// good is handled in