NoaInformationOverlay
このクラスを介して、Informationのオーバーレイの登録や削除などを行うことができます。
※ NOA Debugger が提供する機能を利用する場合は、必ず NOA_DEBUGGER のシンボル定義を利用してください。
Static Methods
| API | 説明 |
|---|---|
| RegisterGroup(groupName, layout, initialTargets, callbacks) | オーバーレイグループを登録します。 オーバーレイの識別名、レイアウト設定、表示対象の一覧、コールバックをパラメータとして指定します。 コールバックは省略可能ですが、より詳細な挙動を設定できます。詳しい内容はNoaInformationOverlayCallbacksを参照してください。 |
| RemoveGroup(groupName) | 指定のオーバーレイグループを削除します。 |
| RemoveAllGroups() | 全てのオーバーレイグループを削除します。 |
| IsGroupRegistered(groupName) | 指定のオーバーレイグループが登録済みかどうかを返します。 |
| RefreshAll() | 全てのオーバーレイグループの表示を一括更新します。 |
NoaInformationOverlayTargetKey
プログラム経由のInformationオーバーレイで表示する1項目を表す型です。
キー名はInformationの各タブの「要素名」をそのまま指定できます。
| プロパティ | 説明 |
|---|---|
| Category | Informationのカテゴリ種別 |
| GroupName | 各タブ内のデータグループ名 |
| Key | 項目のキー名 |
NoaInformationOverlayLayout
オーバーレイのレイアウト設定です。
| プロパティ | 説明 |
|---|---|
| Position | オーバーレイの表示位置を指定します。 |
| Scale | オーバーレイのサイズを0.5〜1.5の範囲で指定します。 |
| Axis | オーバーレイの表示対象項目を並べる際の方向を指定します。 |
サンプルコード
using System.Collections.Generic;
using UnityEngine;
#if NOA_DEBUGGER
using NoaDebugger;
#endif
public class Example
{
void ExampleMethod()
{
#if NOA_DEBUGGER
// レイアウト
var layoutCustom = new NoaInformationOverlayLayout
{
Position = NoaDebug.OverlayPosition.LowerRight,
Scale = 1.1f,
Axis = NoaInformation.OverlayAxis.Horizontal,
};
// コールバック
var callbacks = new ExampleCustomOverlayCallbacks();
// グループの識別名
string groupName = "SampleGroup";
// 初期表示対象
var initialTargets = new List<NoaInformationOverlayTargetKey>
{
new(InformationTabType.App, "Build", "Company Name"),
new(InformationTabType.App, "Build", "Product Name"),
new(InformationTabType.Device, "Device", "Model"),
};
// オーバーレイグループを登録(コールバックあり)
NoaInformationOverlay.RegisterGroup(
groupName: groupName,
layout: layoutCustom,
initialTargets: initialTargets,
callbacks: callbacks);
// 全てのオーバーレイグループの表示を一括更新
NoaInformationOverlay.RefreshAll();
// オーバーレイグループが登録されているかをチェック
bool isRegistered = NoaInformationOverlay.IsGroupRegistered(groupName);
// オーバーレイグループを削除
NoaInformationOverlay.RemoveGroup(groupName);
// 全てのオーバーレイグループを削除
NoaInformationOverlay.RemoveAllGroups();
#endif
}
}
