Skip to content

Instantly share code, notes, and snippets.

View sokuhatiku's full-sized avatar

Sokuhatiku sokuhatiku

View GitHub Profile
@sokuhatiku
sokuhatiku / DrawScriptField.cs
Last active February 7, 2017 06:29
description of code of create "Script" field
EditorGUI.BeginDisabledGroup(true); // ここからEndDisabledGroup()までの間にあるフィールドの値変更を禁止(trueで有効になる)
EditorGUILayout.ObjectField( // Objectを参照出来るフィールドを設置する関数
"Script", // フィールド名
MonoScript.FromMonoBehaviour((MonoBehaviour)target) , // 今回の要、MonoScriptオブジェクトを取得する
typeof(MonoScript), // Fieldが利用出来る型を制限する
false); // Hierarchyにあるオブジェクトを選択できるかどうか(今回は禁止)
EditorGUI.EndDisabledGroup(); // 値変更禁止エリア ここまで
@sokuhatiku
sokuhatiku / AssetTypeCheckerWindow.cs
Last active February 8, 2017 04:34
Create AssetType Checker window
using UnityEngine;
using UnityEditor;
public class AssetTypeCheckerWindow : EditorWindow
{
Object obj;
string msg;
[MenuItem("Window/AssetType Checker")]
static void Init()
@sokuhatiku
sokuhatiku / DrawScriptAndEditorField.cs
Created February 7, 2017 07:11
Draw "Script" field and "Editor" field.
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.ObjectField("Script", MonoScript.FromMonoBehaviour((MonoBehaviour)target), typeof(MonoScript), false);
EditorGUILayout.ObjectField("Editor", MonoScript.FromScriptableObject(this), typeof(MonoScript), false);
EditorGUI.EndDisabledGroup();
@sokuhatiku
sokuhatiku / config.yaml
Last active January 25, 2023 10:45
Verdaccio for Unitypackage
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: ./storage
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using UnityEditor;
using UnityEngine;
using UnityEngine.Networking;
public class PackageDownloadTest : EditorWindow
{
@sokuhatiku
sokuhatiku / Info.cs
Created April 30, 2019 08:28
VitDeck GUI flow
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace VitDeck.Main
{
public class Info
{
public static event Action<Info> OnInstantiated;
public static IEnumerable<Object> LoadAssetsFromPathWithSubAssets(this IEnumerable<string> paths)
{
foreach (var path in paths)
{
var assets = AssetDatabase.LoadAllAssetsAtPath(path);
if (assets == null || assets.Length == 0)
{
yield return AssetDatabase.LoadAssetAtPath<Object>(path);
yield break;
}
@sokuhatiku
sokuhatiku / HideFlags for Spreadsheet.md
Last active June 2, 2019 12:34
UnityEngine.HideFlags Checker
= TEXTJOIN(" | ", TRUE, IF($F2 = 0, "HideFlags.None", ""), IF(BITAND($F2, 1) = 1, "HideFlags.HideInHierarchy", ""), IF(BITAND($F2, 2) = 2, "HideFlags.HideInInspector", ""), IF(BITAND($F2, 4) = 4, "HideFlags.DontSaveInEditor", ""), IF(BITAND($F2, 8) = 8, "HideFlags.NotEditable", ""), IF(BITAND($F2, 16) = 16, "HideFlags.DontSaveInBuild", ""), IF(BITAND($F2, 32) = 32, "HideFlags.DontUnloadUnusedAsset", ""), IF(BITAND($F2, 52) = 52, "HideFlags.DontSave", ""), IF(BITAND($F2, 61) = 61, "HideFlags.HideAndDontSave", ""))
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace Sokuhatiku.TunnelShader
{
public class TunnelMeshCompressor : EditorWindow
{
private const string Name = "Tunnel Mesh Complesser";
using UnityEngine;
using UnityEditor;
public class AssetTypeCheckerWindow : EditorWindow
{
Object obj;
string msg;
[MenuItem("Window/AssetType Checker")]
static void Init()