123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- /*===============================================================================
- Copyright (C) 2022 Immersal - Part of Hexagon. All Rights Reserved.
- This file is part of the Immersal SDK.
- The Immersal SDK cannot be copied, distributed, or made available to
- third-parties for commercial purposes without written permission of Immersal Ltd.
- Contact sdk@immersal.com for licensing requests.
- ===============================================================================*/
- using UnityEngine;
- namespace Immersal.Samples.Mapping
- {
- public class ToggleMappingMode : MonoBehaviour
- {
- public GameObject mappingUIPrefab;
- private GameObject m_MappingUI;
- public GameObject MappingUI
- {
- get { return m_MappingUI; }
- }
- void Start()
- {
- LoginManager loginManager = LoginManager.Instance;
- if (loginManager != null)
- {
- loginManager.OnLogin += EnableMappingMode;
- loginManager.OnLogout += DisableMappingMode;
- }
- }
- public void EnableMappingMode()
- {
- if (m_MappingUI == null)
- {
- m_MappingUI = Instantiate(mappingUIPrefab);
- }
- else
- {
- m_MappingUI.SetActive(true);
- }
- }
- public void DisableMappingMode()
- {
- if (m_MappingUI != null)
- {
- m_MappingUI.SetActive(false);
- }
- }
- }
- }
|