void OnAccessToken(AccessToken accessToken) { if (accessToken == null) { return; } if (m_SyncStoreManager == null) { m_SyncStoreManager = FindObjectOfType <MarkerSyncStoreManager>(); } try { if (m_SyncStoreManager) { m_SyncStoreManager.UpdateProject(m_ActiveProjectSelector.GetValue(), accessToken.UnityUser); } } catch (Exception e) { Debug.LogError($"[MarkerProjectManager.SetProject] Exception thrown updating project: {e}"); } m_GraphicManager.UnityProject = accessToken.UnityProject; m_MarkerController.ReadOnly = ReadOnly(accessToken.UnityProject); // Now the project is set, mark as available. if (m_MarkerController.UnsupportedMessage == null) { m_MarkerController.Available = true; } }
void Awake() { #if !DEBUG // Disable development tool on production if (m_ToggleTools) { m_ToggleTools.gameObject.SetActive(false); } gameObject.SetActive(false); return; #endif if (m_SyncStoreManager == null) { m_SyncStoreManager = FindObjectOfType <MarkerSyncStoreManager>(); } // There needs to be a syncstoremanager active and enabled for this script to be useful. Debug.Assert(m_SyncStoreManager, "MarkerSyncStoreManager needs to be available to test it's functionality."); Debug.Assert(m_SyncStoreManager.enabled, "MarkerSyncStoreManager needs to be enabled to test it's functionality."); m_ActiveMarkerInfoOutput.text = m_MarkerController.ActiveMarker.ToString(); m_MarkerController.OnMarkerUpdated += HandleOnMarkerUpdated; m_SyncNewMarkerButton.onClick.AddListener(SyncNewMarker); m_UpdateActiveMarkerButton.onClick.AddListener(UpdateActiveMarker); m_ToggleTools.onClick.AddListener(TogglePanel); m_DialogWindow = GetComponent <DialogWindow>(); m_DialogWindow.Close(); }