Skip to content

Instantly share code, notes, and snippets.

public class TestGistClass{
public int num = 0;
private string _text = "hello";
public TestGistClass(int argNum,string argText){
num = argNum;
_text = argText;
}
<?php
//======スプレッドシートの取得 ここから======
require './hoge/Ghostsheet.php';
$gs = new Ghostsheet();
$gs->set('cache', './hoge');
$mySpreadsheetId = 'hogehogehoge'; //スプレッドシートのIDを設定
@takashicompany
takashicompany / UnityEditorAppIconChange.cs
Last active December 27, 2015 11:19
UnityのEditor ScriptでiPhone / Androidアプリのアイコンを変更するスクリプト。 プロジェクト内のフォルダからアイコン画像を取得して設定する。
// Editor Scriptで書くこと。
Texture2D[] currentIcons; //現在設定されているアイコンのテクスチャー
Texture2D[] newIcon; //新しく設定するアイコンのテクスチャー
int[] iconSizes;
// 現在のアイコンを取得。
currentIcons = PlayerSettings.GetIconsForTargetGroup(BuildTargetGroup.Android);
@takashicompany
takashicompany / gist:7523219
Created November 18, 2013 05:59
UnityでAndroidプラグインの関数を使う時に使うスクリプト
void Awake () {
// UnityPlayerクラスを取得
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
// 現在のActivityを取得
AndroidJavaObject activity = jc.GetStatic<AndroidJavaObject>("currentActivity");
// Contextを取得
AndroidJavaObject context = activity.Call<AndroidJavaObject>("getApplicationContext");
Mobile Splash Screen = 320 * 480
iPhone3.5"/Retina = 640 * 960
iPhone4"/Retina = 640 * 1136
iPad Portrait = 768 * 1024
High Res. iPad Portrait = 1536 * 2048
@takashicompany
takashicompany / LogCallbackSample
Created March 3, 2014 14:49
UnityのApplication.RegisterLogCallbackの検証
using UnityEngine;
using System;
using System.Collections;
public class LogCallbackSample : MonoBehaviour {
public string condition = "";
public string stackTrace = "";
public string systemStackTrace = "";
public LogType type;
@takashicompany
takashicompany / RegisterLogCallbackSample.cs
Created March 3, 2014 14:58
Sample for Application.RegisterLogCallback (Unity)
void Awake ()
{
Application.RegisterLogCallback(LogCallBackHandler);
}
void LogCallBackHandler(string condition, string stackTrace, LogType type)
{
// condition :
// Debug.Log, Debug.LogWarning, Debug.LogError, Debug.LoeException Argument.
void Awake ()
{
Application.RegisterLogCallback(LogCallBackHandler);
}
void LogCallBackHandler(string condition, string stackTrace, LogType type)
{
// 取得したログの情報を処理する
}
void LogCallBackHandler(string condition, string stackTrace, LogType type)
{
// System.Diagnostics.StackTraceを使う
System.Diagnostics.StackTrace systemStackTrace = new System.Diagnostics.StackTrace(true);
string systemStackTraceStr = systemStackTrace.ToString();
}
@takashicompany
takashicompany / UseExtend.cs
Created March 25, 2014 16:30
Unityで継承を用いて共通化を図る例。おそらくこれが良い方法。
// 共通化のクラス
public class MyButton : MonoBehaviour
{
void Press ();
}
// MyButtonを実装したクラス
public class StartButton : MyButton
{
public void Press ()