Esempio n. 1
0
    protected void StartArSession(Dictionary <int, TriggerObject> triggerObjects)
    {
        if (_sessionStarted)
        {
            return;
        }
        var config = sessionConfiguration;

        if (config.IsSupported)
        {
            foreach (var key in triggerObjects.Keys)
            {
                var triggerObject = triggerObjects[key];
                if (_storedObjects.ContainsKey(triggerObject.triggerImageURL))
                {
                    continue;
                }
                _storedObjects[triggerObject.triggerImageURL] = triggerObject;
                byte[] bytes = triggerObject.texture.EncodeToJPG();
                m_session.StoreTriggerImage("" + key, bytes.Length, bytes, triggerObject.width);
            }
            m_session.RunWithConfigAndImages(config);
            UnityARSessionNativeInterface.ARFrameUpdatedEvent += FirstFrameUpdate;
        }
    }