This file contains 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 System; | |
using System.IO; | |
using uOSC; | |
public static class uOSCUtils | |
{ | |
/* | |
var bytes = uOSCUtils.ByteFromMsg(message); | |
Debug.LogWarning(bytes.Length); |
This file contains 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
// 再帰的に子オブジェクトを検索するメソッド | |
Transform FindChildByName(Transform parent, string childName) | |
{ | |
// 現在の親オブジェクトの全ての子オブジェクトをループ | |
foreach (Transform child in parent) | |
{ | |
// 子オブジェクトの名前が一致する場合、その子オブジェクトを返す | |
if (child.name == childName) | |
{ | |
return child; |
This file contains 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 System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
/// <summary> | |
/// UnityのMathfをdoubleで行う。 | |
/// 精度を上げるため | |
/// </summary> | |
public class MathExtend |
This file contains 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 System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using UnityEngine; | |
public class TaskExtensions | |
{ | |
/** | |
This file contains 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
/** | |
CancellationTokenSource eventActCts; | |
void Cancel_AsynEventTest() | |
{ | |
if(eventActCts != null) | |
{ | |
eventActCts.Cancel(); | |
} | |
eventActCts = null; |
This file contains 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.Threading.Tasks; | |
using System.Threading; | |
public static class LeanTweenAsyncExtensions | |
{ | |
//public static async Task AwaitCompletionAsync(this LTDescr tween) | |
//{ | |
// var tcs = new TaskCompletionSource<bool>(); | |
// tween.setOnComplete(() => tcs.TrySetResult(true)); |
This file contains 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
/// <summary> | |
/// Equirectangular座標から球面の3D座標に変換する関数 | |
/// </summary> | |
/// <param name="lon">経度(0から1の範囲)</param> | |
/// <param name="lat">緯度(0から1の範囲)</param> | |
/// <returns></returns> | |
Vector3 EquirectangularToSphereCoordinates(float lon, float lat) | |
{ | |
float u = lon; | |
float v = lat; |
This file contains 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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[ExecuteInEditMode] | |
public class MeshTextureColorPicker : MonoBehaviour | |
{ | |
/// <summary> | |
/// Meshをstaticにしているとbatchで結合されsubmeshIndexが異なり正常に取得できなくなる。 | |
/// 対応方法 (対象となるMeshをBatchingの対応外にする) |
This file contains 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.Generic; | |
public class MainThreadDispatcher : MonoBehaviour | |
{ | |
private static MainThreadDispatcher instance; | |
private static readonly object lockObject = new object(); | |
private Queue<System.Action> actions = new Queue<System.Action>(); |
This file contains 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 System; | |
using System.Linq; | |
using System.Reflection; | |
using UnityEngine; | |
public static class CommandLineArgsUtils | |
{ | |
// https://github.com/baba-s/Kogane.CommandLineParser/tree/master/Editor | |
/** |
NewerOlder