ドキュメント

Unity Engine

Unity Engine

currentFoldingFeatures

Provides an array of AndroidFoldingFeature data for the current display.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

public static AndroidFoldingFeature[] currentFoldingFeatures { get; }

Remarks

Returns an empty array if the current display doesn't support folding features. Use this information immediately after requesting as the system updates it automatically.
The following code example demonstrates how to update the UI for full-screen or split-screen modes based on the current folding features data.

Examples

using UnityEngine;using UnityEngine.Android;public class MyApplication : MonoBehaviour{ public void Start() { OnFoldingFeaturesUpdated(AndroidApplication.currentFoldingFeatures); AndroidApplication.onFoldingFeaturesUpdated += OnFoldingFeaturesUpdated; } public void OnDisable() { AndroidApplication.onFoldingFeaturesUpdated -= OnFoldingFeaturesUpdated; } private void OnFoldingFeaturesUpdated(AndroidFoldingFeature[] foldInfo) { if (foldInfo.Length == 0 || !foldInfo[0].isSeparating) { // update UI for full screen } else // foldInfo[0].isSeparating { // update UI for split screen using foldInfo[0].bounds and foldInfo[0].occlusionType } }}