facebook twitter hatena line email

Unity/おすすめアセット/SRDebugger

提供: 初心者エンジニアの簡易メモ
2023年8月16日 (水) 00:46時点におけるAdmin (トーク | 投稿記録)による版 (Optionの作り方)

移動: 案内検索

インストール

Assets/StompyRobot/SRDebugger

使い方

インストールすると、自動で反映され、左上を3タップでコンソール画面が起動する。

Optionの作り方&使い方

using System.ComponentModel;

public partial class SROptions
{
	private float _myProperty = 0.5f;
	[Category("My Category")]
	public float MyProperty
	{
		get { return _myProperty; }
		set { _myProperty = value; }
	}
	private float _myRangeProperty = 0f;
	[NumberRange(0, 10)]
	[Category("My Category")]
	public float MyRangeProperty
	{
		get { return _myRangeProperty; }
		set { _myRangeProperty = value; }
	}
}

Optionの使い方

Debug.Log(SROptions.Current.MyProperty); // 0.5