ドキュメント

Unity Engine

Download Unity

Unity Engine

UnregisterLayoutChangedCallback(Action<DisplayLayoutChangedEventArgs>)

Removes a callback that was registered with DisplayInfo.RegisterLayoutChangedCallback.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static bool UnregisterLayoutChangedCallback(Action<DisplayLayoutChangedEventArgs> callback)

Parameters

The callback to remove from the display layout changed notification list. If
callback
is null, Unity throws an
ArgumentNullException
.

Returns

Type

Description

booltrue if the callback was registered and has been removed, otherwise false.

Remarks

This method is supported only in Linux, Embedded Linux and QNX players. In the Editor and on other platforms it throws a
NotSupportedException
.

Examples

using System.Collections.Generic;using UnityEngine;public class DisplayLayoutWatcher : MonoBehaviour{ private List<DisplayInfo> displays = new List<DisplayInfo>(); void OnEnable() { DisplayInfo.RegisterLayoutChangedCallback(OnDisplayLayoutChanged); } void OnDisable() { DisplayInfo.UnregisterLayoutChangedCallback(OnDisplayLayoutChanged); } void OnDisplayLayoutChanged(DisplayLayoutChangedEventArgs args) { DisplayInfo.GetLayout(displays); Debug.Log("Display layout changed. Display count: " + displays.Count); }}