我正在研究Google Tango應用程序,我一直試圖使用TangoApplication
類保存區域說明。保存區域說明暫停應用程序
我現在有呼籲OnApplicationPause()
事件
private void DoSaveCurrentAreaDescription(bool forceLearningMode)
{
// Disable interaction before saving.
m_initialized = false;
if (m_tangoApplication.m_areaDescriptionLearningMode)
{
// The keyboard is not readable if you are not in the Unity main thread. Cache the value here.
string name = "config";
// Start saving process in another thread.
m_saveThread = new Thread(delegate()
{
// Start saving process in another thread.
m_curAreaDescription = AreaDescription.SaveCurrent();
AreaDescription.Metadata metadata = m_curAreaDescription.GetMetadata();
metadata.m_name = name;
m_curAreaDescription.SaveMetadata(metadata);
m_TangoManager.m_lastKnownAreaDescription = m_curAreaDescription;
m_TangoManager.SaveProductLocationsToDisk();
});
m_saveThread.Start();
}
else
{
m_TangoManager.SaveProductLocationsToDisk();
}
}
此獲取應用程序暫停功能中調用,但它不允許我保存ADF下面的函數。如果我在應用程序仍在運行時調用此函數,它將被保存。
如果任何人有任何想法會發生什麼(我假設線程問題與背後的過程)我會永遠在你的債務。