Skip to content

Instantly share code, notes, and snippets.

public class AsyncTest : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
// コルーチン実行
StartCoroutine(AsyncCoroutineCaller(() =>
{
// async/await実行
AsyncTaskCaller();
@afjk
afjk / gist:130b7c17f834ba72c3e31fcb8dd8a027
Created July 26, 2020 02:47
Linqで最初の要素を取得する。デフォルトはnull
List<bool> container = new List<bool>();
// containerに値セット
var item = container.FirstOrDefault(x => x == true );
@afjk
afjk / TargetClassInspector.cs
Created July 26, 2020 01:29
エディタ拡張:Inspectorにボタンを表示して対象クラスのPublicメソッドを呼び出す
// Editorフォルダ配下に配置
using UnityEditor;
using UnityEngine;
namespace STYLY
{
[CustomEditor(typeof(TargetClass))]
public class TargetClassInspector : Editor
{
public override void OnInspectorGUI()
@afjk
afjk / ContextMenuExample.cs
Created July 25, 2020 23:43
UnityEditorExtension:Inspectorの右のメニューからのメソッド呼び出し
[ContextMenu("FuncName")]
public void FuncName()
{
Debug.Log("FuncName called.");
}
using UnityEngine;
using System.Collections;
public class MazeMaker : MonoBehaviour {
public delegate void MazeMakerEventHandler(object sender );
public event MazeMakerEventHandler MakeComplete;
public int randomSeed = -1;
public int xMax;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MazeMakerGrow : MonoBehaviour {
public bool growOnStart = false;
public int xMax = 11;
public int yMax = 11;
public int zMax = 11;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MazeMakerGrowInObj : MonoBehaviour {
public bool growOnStart = false;
public int xMax = 11;
public int yMax = 11;
public int zMax = 11;
@afjk
afjk / autoInput.rb
Last active December 26, 2015 00:49
require 'open3'
#-------------------------------------------------------------------------------
LOG_FILE = 'inputlog.log'
#-------------------------------------------------------------------------------
# Androidでの入力のログファイルへの出力
#-------------------------------------------------------------------------------
def recordToLogFile
Open3.popen3('adb shell') do |stdin,stdout,stderr,thread|
@afjk
afjk / command.txt
Created June 22, 2013 03:44
command sample
コマンド
■Android Shell
●Android アプリ名からプロセスを探してKill(ただし、UNIXシェルから実行。WindowsからならMinGWとか使う)
adb shell ps|grep <プロセス名> |awk '{ print $2 }' | xargs adb shell kill
●圧縮ファイル解凍
busybox unzip -x <圧縮ファイル名>.zip
■Linux
@afjk
afjk / del_comment.py
Created June 21, 2013 14:03
del comment
# -*- coding: CP932 -*-
# コメントの削除
import re
import codecs
import csv
import os
import string
DIR_NAME = r"D:\src"
MOD_DIR_NAME = r"D:\dest"