Skip to content

Instantly share code, notes, and snippets.

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;
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 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;
@afjk
afjk / ContextMenuExample.cs
Created July 25, 2020 23:43
UnityEditorExtension:Inspectorの右のメニューからのメソッド呼び出し
[ContextMenu("FuncName")]
public void FuncName()
{
Debug.Log("FuncName called.");
}
@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 / gist:130b7c17f834ba72c3e31fcb8dd8a027
Created July 26, 2020 02:47
Linqで最初の要素を取得する。デフォルトはnull
List<bool> container = new List<bool>();
// containerに値セット
var item = container.FirstOrDefault(x => x == true );
public class AsyncTest : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
// コルーチン実行
StartCoroutine(AsyncCoroutineCaller(() =>
{
// async/await実行
AsyncTaskCaller();