Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baba-s/uni-debug-menu
横向きかつクリックやタップ可能なゲームで使用できるカスタマイズ可能なデバッグメニュー
https://github.com/baba-s/uni-debug-menu
kogane-unity-lib unity unity3d
Last synced: 3 months ago
JSON representation
横向きかつクリックやタップ可能なゲームで使用できるカスタマイズ可能なデバッグメニュー
- Host: GitHub
- URL: https://github.com/baba-s/uni-debug-menu
- Owner: baba-s
- License: mit
- Created: 2019-03-18T03:02:42.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-26T09:23:21.000Z (almost 6 years ago)
- Last Synced: 2024-11-10T16:44:56.100Z (3 months ago)
- Topics: kogane-unity-lib, unity, unity3d
- Language: C#
- Homepage: http://baba-s.hatenablog.com/entry/2019/03/19/090000
- Size: 4.58 MB
- Stars: 23
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-unity-open-source-on-github - uni-debug-menu - Customizable debug menu (Script Debug)
README
# UniDebugMenu
横向きかつクリックやタップ可能なゲームで使用できるカスタマイズ可能なデバッグメニュー
[](https://github.com/baba-s/uni-debug-menu/releases)
[](https://github.com/baba-s/uni-debug-menu/releases)


[](https://github.com/baba-s/uni-debug-menu/blob/master/LICENSE)## 機能
- 3種類のメニュー表示を使用可能
- テキスト表示
- ボタン表示
- カスタマイズ可能なボタン表示
- 大量のデータを実装可能
- 多階層のメニューを実装可能
- 検索可能
- カテゴリ分け可能
- トースト表示
- イベント検知
- ドラッグ可能な開くボタン
- どこからでも開ける
- 複数解像度対応## バージョン
- Unity 2018.3.7f1
## サンプル
### トップ画面

### システム情報



### システムコマンド


### ゲームオブジェクト一覧

### ログ情報


## 3種類のメニュー表示を使用可能
### テキスト表示

### ボタン表示


### カスタマイズ可能なボタン表示

## 大量のデータを実装可能

## 多階層のメニューを実装可能

## 検索可能

## カテゴリ分け可能

## トースト表示

## ドラッグ可能な開くボタン

## どこからでも開ける

## 複数解像度対応
### 18:9

### 4:3

## 使い方
- 「Assets/UniDebugMenu/Example」に含まれているシーンやスクリプトを
参考にしていただければと思います### デバッグメニューを呼び出すサンプル
```cs
using UnityEngine;
using UnityEngine.SceneManagement;namespace UniDebugMenu.Example
{
///
/// デバッグメニューのサンプルを管理するクラス
///
public sealed class UniDebugMenuExampleScene : MonoBehaviour
{
//==============================================================================
// 変数
//==============================================================================
private ExampleTopListCreator m_creator;//==============================================================================
// 関数
//==============================================================================
///
/// 初期化される時に呼び出されます
///
private void Awake()
{
// デバッグメニューのトップ画面のリストを管理するインスタンスを作成します
m_creator = new ExampleTopListCreator();
m_creator.Init();// デバッグメニューのシーンを加算で読み込みます
SceneManager.LoadScene( "UniDebugMenuScene", LoadSceneMode.Additive );// デバッグメニューでコマンドが実行された時に呼び出されます
UniDebugMenuScene.mOnChange += () => Debug.Log( "UniDebugMenuScene.mOnChange" );// DM ボタンが押された時にデバッグメニューのトップ画面を開くように設定します
UniDebugMenuScene.mOnOpen += () => DMType.BUTTON_COL_3.Open( m_creator );
}///
/// デバッグメニューを開くボタンが押された
///
public void OnClick1()
{
// デバッグメニューのトップ画面を開きます
DMType.BUTTON_COL_3.Open( m_creator );
}///
/// システムコマンドの画面を開くボタンが押された
///
public void OnClick2()
{
// デバッグメニューのシステムコマンドの画面を開きます
DMType.COMMAND_TAB_6.Open( new SystemCommandListCreator() );
}///
/// デバッグメニューを開く DM ボタンを透明にするボタンが押された
///
public void OnClick3()
{
// DM ボタンを透明にします
// DM ボタンは透明になるだけで当たり判定は有効のままになります
// true:不透明 false:透明
UniDebugMenuScene.SetOpenButtonVisible( false );
}///
/// デバッグメニューを削除するボタンが押された
///
public void OnClick4()
{
// デバッグメニューのゲームオブジェクトを削除します
if ( UniDebugMenuScene.Destroy() )
{
// デバッグメニューのゲームオブジェクトが削除できた場合は
// デバッグメニューのシーンもアンロードします
SceneManager.UnloadSceneAsync( "UniDebugMenuScene" );
}
}
}
}
```### リストを作成するサンプル
```cs
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;namespace UniDebugMenu.Example
{
///
/// デバッグメニューのトップ画面のリストを作成するクラス
///
[Serializable]
public sealed class ExampleTopListCreator : ListCreatorBase, IDisposable
{
//==============================================================================
// 変数(readonly)
//==============================================================================
private readonly ActionData[] m_sourceList;// ログ情報のリストを作成するインスタンス
private readonly LogListCreator m_logDataCreator = new LogListCreator( 1500 );//==============================================================================
// 変数
//==============================================================================
private IList m_list;//==============================================================================
// プロパティ
//==============================================================================
public override int Count => m_list.Count;public override ActionData[] OptionActionList => new []
{
new ActionData( "ボタン1" , () => Debug.Log( "ボタン1が押されました" ) ),
new ActionData( "ボタン2" , () => Debug.Log( "ボタン2が押されました" ) ),
new ActionData( "ボタン3" , () => Debug.Log( "ボタン3が押されました" ) ),
new ActionData( "ボタン4" , () => Debug.Log( "ボタン4が押されました" ) ),
new ActionData( "ボタン5" , () => Debug.Log( "ボタン5が押されました" ) ),
};//==============================================================================
// 関数
//==============================================================================
///
/// コンストラクタ
///
public ExampleTopListCreator()
{
m_sourceList = new []
{
new ActionData( "テキスト表示サンプル" , () => OpenAdd( DMType.TEXT_TAB_6 , new TextListCreatorExample() ) ),
new ActionData( "ボタン表示サンプル 2列" , () => OpenAdd( DMType.BUTTON_COL_2 , new TextListCreatorExample() ) ),
new ActionData( "ボタン表示サンプル 3列" , () => OpenAdd( DMType.BUTTON_COL_3 , new TextListCreatorExample() ) ),
new ActionData( "システム情報" , () => OpenAdd( DMType.TEXT_TAB_6 , new SystemInfoListCreator() ) ),
new ActionData( "システムコマンド" , () => OpenAdd( DMType.COMMAND_TAB_6 , new SystemCommandListCreator() ) ),
new ActionData( "ゲームオブジェクト一覧" , () => OpenAdd( DMType.COMMAND_TAB_6 , new GameObjectListCreator() ) ),
new ActionData( "ログ情報" , () => OpenAdd( DMType.TEXT_TAB_6 , m_logDataCreator ) ),
};
}///
/// 初期化します
///
public void Init() => m_logDataCreator.Init();///
/// 破棄します
///
public void Dispose() => m_logDataCreator.Dispose();///
/// リストの表示に使用するデータを作成します
///
protected override void DoCreate( ListCreateData data )
{
m_list = m_sourceList
.Where( c => data.IsMatch( c.m_text ) )
.ToArray()
.ReverseIf( data.IsReverse )
;
}///
/// 指定されたインデックスの要素の表示に使用するデータを返します
///
protected override ActionData DoGetElemData( int index ) => m_list.ElementAtOrDefault( index );
}
}
```## ライセンス
- このリポジトリは下記のアセットを使用させていただいております
- [Unity_UI_Samples](https://github.com/tsubaki/Unity_UI_Samples)
- [Rounded Mgen+](http://jikasei.me/font/rounded-mgenplus/)