Skip to content

Instantly share code, notes, and snippets.

/// <summary>
/// Pingによる応答時間の取得
/// </summary>
public async void OnClickGetPingTime()
{
int pingTime = await PingStatus.GetPingTime();
}
@st0326s
st0326s / file0.txt
Last active August 11, 2018 08:33
Unity Wifi・キャリア電波レベルの取得(Android) ref: https://qiita.com/satotin/items/fce283d6b391f6f2b380
using UnityEngine;
/// <summary>
/// 電波状態の取得クラス(WIFI/キャリア)
/// </summary>
public static class NetworkStatus
{
/// <summary>
/// 電波強度MAX値
/// </summary>
@st0326s
st0326s / file0.txt
Last active April 24, 2018 11:01
Unity Task実行 Taskキャンセル async await メモ ref: https://qiita.com/satotin/items/4f9fb20cefc057d7641b
using UnityEngine;
using UnityEngine.UI;
using System.Threading;
using System.Threading.Tasks;
public class TaskTest : MonoBehaviour {
// MainThreadのコンテキストを取得.
SynchronizationContext context = null;
CancellationTokenSource tokenSource = new CancellationTokenSource();
@st0326s
st0326s / file0.txt
Last active May 9, 2018 01:14
拡張メソッド作り方 メモ ref: https://qiita.com/satotin/items/b643cc6765009b75f20e
using UnityEngine;
public class ExtensionTest : MonoBehaviour {
public void OnExtensionTest()
{
var test = new Test()
{
a = 1,
b = "abc"
PhotonNetwork.isMasterClient
@st0326s
st0326s / file0.txt
Last active March 22, 2018 10:57
Unityからアプリダウンロード用のAppStore、GooglePlayへの遷移先URL メモ ref: https://qiita.com/satotin/items/83401320173adfe88a92
 https://play.google.com/store/apps/details?id=アプリID
@st0326s
st0326s / file0.txt
Created December 6, 2017 11:54
UnityからTestFlight GooglePlay 遷移先URL メモ ref: https://qiita.com/satotin/items/6fce271095072addecb1
 Application.OpenURL("https://beta.itunes.apple.com/v1/app/iTunesConnectのアプリID");
@st0326s
st0326s / file0.txt
Last active November 24, 2017 08:35
UnityからADID・IDFAを取得 ref: https://qiita.com/satotin/items/f4afb0a08adbec26a062
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GetIdfaAndAdid : MonoBehaviour {
[SerializeField]
public Text DisplayID;
@st0326s
st0326s / file0.txt
Created August 21, 2017 08:13
Unity5.6.2 Android ビルドエラー対応 ref: http://qiita.com/satotin/items/bd31892894da37da6840
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
@st0326s
st0326s / file0.txt
Last active June 16, 2017 09:03
MessagePack-CSharp Array型 メモ ref: http://qiita.com/satotin/items/8456e3f9c78be44ac961
using System.Collections.Generic;
using System.Text;
using MessagePack;
[MessagePackObject]
public class SubClass
{
[Key(0)]
public int acb;