Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

AndroidApplication.onFoldingFeaturesUpdated

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A callback to detect the folding features changes when the application is running.

Unity passes an updated array of AndroidFoldingFeature data to the callback.

The following code example demonstrates how to update the UI for full-screen or split-screen modes based on the current folding features data.

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[] ffs) { if (ffs.Length == 0 || !ffs[0].isSeparating) { // update UI for full screen } else // ffs[0].isSeparating { // update UI for split screen using ffs[0].bounds and ffs[0].occlusionType } } }