Skip to content

Instantly share code, notes, and snippets.

@st0326s
st0326s / file0.txt
Last active June 16, 2017 09:02
MessagePack-CSharp Map型 メモ ref: http://qiita.com/satotin/items/f1ea6d67fe3869212542
using System.Collections.Generic;
using System.Text;
using MessagePack;
[MessagePackObject(true)]
public class ListTest
{
public int acb;
public StringBuilder def;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MsgPack;
using MsgPack.Serialization;
public class test : MonoBehaviour {
@st0326s
st0326s / file0.txt
Last active May 31, 2017 05:52
デバイストークン取得(Unity) ref: http://qiita.com/satotin/items/6e513a8945d5ca285188
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GetToken : MonoBehaviour {
// Use this for initialization
void Start () {
UnityEngine.iOS.NotificationServices.RegisterForNotifications(
var webView = ゲームオブジェクト.GetComponent<UniWebView>();
@st0326s
st0326s / file0.txt
Last active June 11, 2018 07:48
Unity C#で暗号化・復号化 メモ ref: http://qiita.com/satotin/items/6e0dc0a90312c5d474df
using System;
using System.Text;
using System.Security.Cryptography;
namespace Musashi.WebApi_v1.Utility
{
/// <summary>
/// 暗号化・複合化を行う
/// </summary>
public static class Crypt
@st0326s
st0326s / file0.txt
Created March 8, 2017 12:02
Unity上でのテクスチャサイズ一覧取得 ref: http://qiita.com/satotin/items/a0e43dddfd0df1fbff19
using UnityEngine;
using UnityEditor;
using System.Reflection;
using System;
public static class CalcTextureSize
{
private static Type mType;
@st0326s
st0326s / file0.txt
Created February 22, 2017 13:06
ImageにResourcesLoadしたSpriteをセット メモ ref: http://qiita.com/satotin/items/8afda2eeb02f795133f0
public Sprite[] textures;
textures = Resources.LoadAll<Sprite>("Chara");
@st0326s
st0326s / file0.txt
Last active February 15, 2017 02:20
OnPostProcessBuild関係 メモ書き ref: http://qiita.com/satotin/items/a56de689bca82e24df29
#if NOTIFICATION_SYSTEM_ENABLE
// Change value of CFBundleVersion in Xcode plist
var buildKey = "UIBackgroundModes";
plist.root.CreateArray (buildKey).AddString ("remote-notification");
#endif
@st0326s
st0326s / file0.cs
Created January 17, 2017 03:49
Unityからスマホ画面の向きの固定・解除(iOS・Android共通) ref: http://qiita.com/satotin/items/2009788da11805a4a9cf
switch (Screen.orientation) {
// 縦画面のとき
case ScreenOrientation.Portrait:
// 左回転して左向きの横画面にする
Screen.orientation = ScreenOrientation.LandscapeLeft;
break;
// 上下反転の縦画面のとき
case ScreenOrientation.PortraitUpsideDown:
// 右回転して左向きの横画面にする
Screen.orientation = ScreenOrientation.LandscapeRight;
// 渡す値
intent.putExtra("A", a);
intent.putExtra("B", b);
// 値の取得
// データがない場合、第2引数の 0 が返る
Integer request_code = intent.getIntExtra("A", 0);
String ticker = intent.getStringExtra("B");