Skip to content

Instantly share code, notes, and snippets.

View じゃんけん in bash
#!/bin/bash
cpuWinCount=0
playerWinCount=0
# 0: あいこ, 1: プレイヤー勝利, 2: cpu勝利,
battle()
{
if [ $1 -eq $2 ]; then
return 0
@Syy9
Syy9 / UnityStatusGetter.cs
Created Jul 31, 2018
How to access Unity Status
View UnityStatusGetter.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public static class UnityStatusGetter {
[MenuItem("Hoge/Fuga %g")]
public static void PrintData()
{
Debug.Log("batches : " + UnityStats.batches);
@Syy9
Syy9 / ChangeInspectorLock.cs
Created Jul 31, 2018
How to change inspector lock
View ChangeInspectorLock.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public static class ChangeInspectorLock {
[MenuItem("Hoge/Fuga %g")]
public static void ChangeLock()
{
var tracker = ActiveEditorTracker.sharedTracker;
@Syy9
Syy9 / AutoPlayPreviewAudio.cs
Created Jul 30, 2018
How to Play Select Audio
View AutoPlayPreviewAudio.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.Reflection;
using System;
public static class AutoPlayPreviewAudio {
@Syy9
Syy9 / CheckTool.cs
Created Jul 30, 2018
How to easily output check results
View CheckTool.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text;
public class _CheckTool {
[MenuItem("CheckTool/Check")]
@Syy9
Syy9 / UnityEditorWindowHelper.cs
Created Jul 28, 2018
How to get Unity default EditorWindow (Game, Scene, Hierarchy...)
View UnityEditorWindowHelper.cs
using UnityEngine;
using UnityEditor;
using System;
public enum WindowType
{
Game,
Scene,
Hierarchy,
Console,
@Syy9
Syy9 / GetUnityTypes.cs
Last active Oct 17, 2020
How to get all EditorWindow types in Unity
View GetUnityTypes.cs
using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
public static class GetUnityTypes
{
public static List<Type> GetEditorWindowTypes()
{
var result = GetSubClassTypes<EditorWindow>();
@Syy9
Syy9 / ShowNotification.cs
Created Jul 28, 2018
How to Show Notification in UnityEditor
View ShowNotification.cs
using UnityEngine;
using UnityEditor;
public static class ShowNotification
{
public static void Show(EditorWindow window,string message)
{
window.ShowNotification(new GUIContent(message));
}
}
@Syy9
Syy9 / GetHierarchyWindow.cs
Created Jul 28, 2018
How to get Unity's HierarchyWindow
View GetHierarchyWindow.cs
using System.Collections;
using UnityEditor;
using UnityEngine;
public static class GetHierarchyWindow
{
private static EditorWindow GetWindow()
{
var assembly = typeof(UnityEditor.EditorWindow).Assembly;
var type = assembly.GetType("UnityEditor.SceneHierarchyWindow");