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

スクリプト言語

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

Event.alt

マニュアルに切り替える
public var alt: bool;

説明

「 Alt/Option 」キーが押されたかどうか(読み取り専用)

On Windows, this returns true if any Alt key is held down.
Mac では、任意のオプションキーが押されている場合、これは true を返します。

	// Prints Option or Alt key was pressed depending the
	// platform this script is being run.
	function OnGUI() {
		var e : Event = Event.current;
		if (e.alt) {
			if(Application.platform == RuntimePlatform.OSXEditor) {
				Debug.Log("Option key was pressed");
			} else if( Application.platform == RuntimePlatform.WindowsEditor) {
				Debug.Log("Alt Key was pressed!");			
			}
		}
	}