Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

EditorPrefs.SetFloat

フィードバック

ありがとうございます

この度はドキュメントの品質向上のためにご意見・ご要望をお寄せいただき、誠にありがとうございます。頂いた内容をドキュメントチームで確認し、必要に応じて修正を致します。

閉じる

送信に失敗しました

なんらかのエラーが発生したため送信が出来ませんでした。しばらく経ってから<a>もう一度送信</a>してください。ドキュメントの品質向上のために時間を割いて頂き誠にありがとうございます。

閉じる

キャンセル

マニュアルに切り替える
public static function SetFloat(key: string, value: float): void;
public static void SetFloat(string key, float value);

パラメーター

説明

key で識別される設定情報の値を設定します。

	// Simple scripts that creates an empty window and remembers the position and size
	// of the created window.

class RememberPosition extends EditorWindow { var width : float = 300; var height : float = 300; var x : float = 100; var y : float = 100;

@MenuItem("Examples/Remember position") static function Init() { var window = GetWindow(RememberPosition); window.Show(); } function Awake() { width = EditorPrefs.GetFloat("EditorWindowWidth", 300); height = EditorPrefs.GetFloat("EditorWindowHeight", 300); x = EditorPrefs.GetFloat("EditorWindowX", 100); y = EditorPrefs.GetFloat("EditorWindowY", 100);

position = Rect(x, y, width, height); } function OnDestroy() { EditorPrefs.SetFloat("EditorWindowWidth", width); EditorPrefs.SetFloat("EditorWindowHeight", height); EditorPrefs.SetFloat("EditorWindowX", x); EditorPrefs.SetFloat("EditorWindowY", y); } function OnGUI() { if(GUILayout.Button("Close")) this.Close(); } }