arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

AR recognition don't work after ipad deep sleep ver2.2 preview-3 Unity2019.1.14f1

Open WangChaolun opened this issue 7 years ago • 6 comments

void OnApplicationFocus(bool hasFocus)
{
    if (hasFocus) { session.Reset(); }
    session.enabled = hasFocus;
}

I try to do like this, but after maybe half hour sleep then wake up, recognition don't work anymore!

Any idea? or solution?

WangChaolun avatar Oct 24 '19 13:10 WangChaolun

void OnApplicationFocus(bool hasFocus)
{
    if (hasFocus)
    {
        StartCoroutine(DoReload());
    }
}

IEnumerator DoReload()
{
    Destroy(session.gameObject);
    yield return null;

    if (sessionPrefab != null)
    {
        session = Instantiate(sessionPrefab).GetComponent<ARSession>();
    }
}

Also try reload, but if i do like this, camera will not work!

WangChaolun avatar Oct 24 '19 13:10 WangChaolun

I want AR Recognition can work correct after wake up, whatever sleep how long time, for now maybe sleep 5minutes is ok, but half hour is not ok!

WangChaolun avatar Oct 24 '19 13:10 WangChaolun

 private void OnApplicationFocus(bool hasFocus)
 {
    if (hasFocus)
    {
        if (loseFocus)
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
        }
        loseFocus = false;
    }
    else
    {
        loseFocus = true;
    }
}

Reload scene also have camera dont work problem!

WangChaolun avatar Oct 25 '19 02:10 WangChaolun

Unity2019.2.10f1 Xcode11-beta5 ARFoundation 3.0-preview4

reload scene fixed!!! cool

but even I reload scene, after sleep still can't recognition

WangChaolun avatar Oct 25 '19 04:10 WangChaolun

Unity2019.2.10f1 Xcode11.2-beta2 ARFoundation 3.0-preview4 iPad_Fall_2018_13.2_17B5077a_Restore

test 20minutes worked

WangChaolun avatar Oct 25 '19 07:10 WangChaolun

Fixed in Unity2019.2.10f1

WangChaolun avatar Nov 12 '19 04:11 WangChaolun