コード例 #1
0
    private void Start()
    {
        mapSession = new MapSession(mapWorker, MapMetaManager.LoadAll());
        mapSession.LoadMapMeta(mapTemp, true);

        mapSession.CurrentMapLocalized = (mapData) =>
        {
            this.mapData = mapData;
        };
        videoCamera.DeviceOpened += () =>
        {
            if (videoCamera == null)
            {
                return;
            }
            videoCamera.FocusMode = CameraDeviceFocusMode.Continousauto;
        };


#if UNITY_EDITOR
        dataDropdown.gameObject.SetActive(true);
        InitPointData();
#endif
        PropDragger.SetMapSession(mapSession);
    }
コード例 #2
0
        public SvcAppSPGlymaSession(GlymaSessionConfiguration configuration)
        {
            _configuration = configuration;
            _sessionId     = Guid.Empty;

            _session    = new MapSession(this);
            _parameters = new MapParameters(this);
        }
コード例 #3
0
        public WebAppSPGlymaSession(string callingUrl)
        {
            _callingUrl = callingUrl;
            _sessionId  = Guid.Empty;

            _session    = new MapSession(this);
            _parameters = new MapParameters(this);
        }
コード例 #4
0
 private void DestroySession()
 {
     if (mapSession != null)
     {
         mapSession.Dispose();
         mapSession = null;
     }
 }
コード例 #5
0
        public SvcAppSPGlymaSession(GlymaSessionConfiguration configuration)
        {
            _configuration = configuration;
            _sessionId = Guid.Empty;

            _session = new MapSession(this);
            _parameters = new MapParameters(this);
        }
コード例 #6
0
        public SvcAppSPGlymaSession(GlymaSessionConfiguration configuration, Guid sessionId)
        {
            _configuration = configuration;
            _sessionId     = sessionId;

            _session = new MapSession(this, _sessionId);

            _parameters = new MapParameters(this);
        }
コード例 #7
0
        public WebAppSPGlymaSession(string callingUrl, Guid sessionId)
        {
            _callingUrl = callingUrl;
            _sessionId  = sessionId;

            _session = new MapSession(this, _sessionId);

            _parameters = new MapParameters(this);
        }
コード例 #8
0
        public SvcAppSPGlymaSession(GlymaSessionConfiguration configuration, Guid sessionId)
        {
            _configuration = configuration;
            _sessionId = sessionId;

            _session = new MapSession(this, _sessionId);

            _parameters = new MapParameters(this);
        }
コード例 #9
0
    void Start()
    {
        _gameManager = FindObjectOfType <GameManager>();

        _mapSessionInstance = FindObjectOfType <MapSession>();

        //This should be added to the network join process
        //i.e. Join/Host Match, Start Game...Start Map Session
        Invoke("InitMappingSession", 2.0f);
    }
コード例 #10
0
        public WebAppSPGlymaSession(string callingUrl, Guid?domainId, Guid?rootMapId, params IRight[] requiredRights)
        {
            _callingUrl = callingUrl;
            _sessionId  = Guid.Empty;

            if (!IsAuthorised(domainId, rootMapId, requiredRights))
            {
                throw new UnauthorizedAccessException("This user does not have the required privileges for this task.");
            }

            _session    = new MapSession(this);
            _parameters = new MapParameters(this);
        }
コード例 #11
0
        internal static string BuildUrl(string restApi, MapSession mapSession, string queryParameters)
        {
            var url =
                RestServiceDomain +
                $"{restApi}?" +
                (string.IsNullOrWhiteSpace(Uri.EscapeDataString(queryParameters)) ?
                 $"key={mapSession.DeveloperKey}" :
                 $"{queryParameters}&key={mapSession.DeveloperKey}");

            // Useful for debugging.
            //UnityEngine.Debug.Log(url);

            return(url);
        }
コード例 #12
0
    void Start()
    {
        //Set up references
        mapSession  = GameObject.Find("MapSession").GetComponent <MapSession> ();
        focusSquare = GameObject.Find("FocusSquare").GetComponent <FocusSquare> ();

        //Mapsession initialization
        bool   isMappingMode = PlayerPrefs.GetInt("IsMappingMode") == 1;
        string mapID         = PlayerPrefs.GetString("MapID");
        string userID        = PlayerPrefs.GetString("UserID");
        string developerKey  = @"PUT DEV KEY HERE";

        mapSession.Init(isMappingMode ? MapMode.MapModeMapping : MapMode.MapModeLocalization, userID, mapID, developerKey);

        //Set callback to handly MapStatus updates
        mapSession.StatusChangedEvent += mapStatus => {
            Debug.Log("status updated: " + mapStatus);
        };

        //Set callback that confirms when assets are stored
        mapSession.AssetStoredEvent += stored => {
            Debug.Log("Assets stored: " + stored);
            Toast("Your bear's garden has been planted!", 2.0f);
        };

        //Set Callback for when assets are reloaded
        mapSession.AssetLoadedEvent += mapAsset => {
            Vector3    position    = new Vector3(mapAsset.X, mapAsset.Y, mapAsset.Z);
            Quaternion orientation = Quaternion.Euler(0, mapAsset.Orientation, 0);
            Debug.Log(mapAsset.AssetId + " found at: " + position.ToString());
            Instantiate(GetPrefab(mapAsset.AssetId), position, orientation);

            Toast("Your bear's garden has been found!", 2.0f);
        };

        //Set up the UI of the scene
        saveAssetButton.SetActive(false);
        placeAssetButtons.SetActive(false);

        if (mapSession.Mode == MapMode.MapModeLocalization)
        {
            placeAssetButtons.SetActive(false);
        }

        Toast("First scan around your area to start!", 10.0f);
    }
コード例 #13
0
    private void InitJido()
    {
        //Set up references
        mapSession  = GameObject.Find("MapSession").GetComponent <MapSession>();
        focusSquare = GameObject.Find("FocusSquare").GetComponent <FocusSquare>();

        //Mapsession initialization
        bool   isMappingMode = PlayerPrefs.GetInt("IsMappingMode") == 1;
        string mapID         = PlayerPrefs.GetString("MapID");
        string userID        = PlayerPrefs.GetString("UserID");

        mapSession.Init(isMappingMode ? MapMode.MapModeMapping : MapMode.MapModeLocalization, userID, mapID);

        //Set callback to handly MapStatus updates
        mapSession.StatusChangedEvent += mapStatus => {
            Debug.Log("status updated: " + mapStatus);
        };

        //Set callback that confirms when assets are stored
        mapSession.AssetStoredEvent += stored => {
            Debug.Log("Assets stored: " + stored);
        };

        //Set Callback for when assets are reloaded
        mapSession.AssetLoadedEvent += LoadAsset;

        mapSession.ObjectDetectedEvent += detectedObject => {
            Debug.Log("Detected " + detectedObject.Name);
        };

        mapSession.ProgressIncrementedEvent += ProgressIncrement;

        //Set up the UI of the scene
        addButton.SetActive(false);

        if (mapSession.Mode == MapMode.MapModeLocalization)
        {
            addButton.SetActive(false);
        }

        Toast("Look around to start!", 5.0f);
    }
コード例 #14
0
 private void Start()
 {
     mapSession = new MapSession(mapWorker, MapMetaManager.LoadAll());
     mapSession.LoadMapMeta(mapTemp, false);
     mapSession.CurrentMapLocalized += (MapData) =>
     {
         //识别出来后播放一段声音 提示用户已经加载出来了
         if (aS.isPlaying == false)
         {
             aS.PlayOneShot(aS.clip);
         }
     };
     videoCamera.DeviceOpened += () =>
     {
         if (videoCamera == null)
         {
             return;
         }
         videoCamera.FocusMode = CameraDeviceFocusMode.Continousauto;
     };
 }
コード例 #15
0
        public WebAppSPGlymaSession(string callingUrl, Guid sessionId, bool isParameter, MapParameter domainParameter, MapParameter rootMapParameter, params IRight[] requiredRights)
        {
            _callingUrl = callingUrl;
            _sessionId  = sessionId;

            IRight[] heightenedRightRequirement = requiredRights;

            Guid?domainId  = null;
            Guid?rootMapId = null;

            if (rootMapParameter == null || rootMapParameter.IsDelayed)
            {
                /// If they passed through a delayed rootmap ID parameter, they are going to have to be a Glyma Map Manager at the very minimum to finish this transaction.
                heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.RootMapCreateRight };
            }
            else
            {
                rootMapId = rootMapParameter.Value;
            }

            if (domainParameter == null || domainParameter.IsDelayed)
            {
                /// If they passed through a delayed domain ID parameter, they are going to have to be a Glyma Project Manager at the very minimum to finish this transaction.
                heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.ProjectCreateRight };
            }
            else
            {
                domainId = domainParameter.Value;
            }

            if (!IsAuthorised(domainId, rootMapId, heightenedRightRequirement))
            {
                throw new UnauthorizedAccessException("This user does not have the required privileges for this task.");
            }

            _session = new MapSession(this, _sessionId);

            _parameters = new MapParameters(this);
        }
コード例 #16
0
        public WebAppSPGlymaSession(string callingUrl, bool isParameter, MapParameter domainParameter, MapParameter rootMapParameter, params IRight[] requiredRights)
        {
            _callingUrl = callingUrl;
            _sessionId = Guid.Empty;

            IRight[] heightenedRightRequirement = requiredRights;

            Guid? domainId = null;
            Guid? rootMapId = null;

            if (rootMapParameter == null || rootMapParameter.IsDelayed)
            {
                /// If they passed through a delayed rootmap ID parameter, they are going to have to be a Glyma Map Manager at the very minimum to finish this transaction.
                heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.RootMapCreateRight };
            }
            else
            {
                rootMapId = rootMapParameter.Value;
            }

            if (domainParameter == null || domainParameter.IsDelayed)
            {
                /// If they passed through a delayed domain ID parameter, they are going to have to be a Glyma Project Manager at the very minimum to finish this transaction.
                heightenedRightRequirement = new IRight[] { SPGlymaRightFactory.Instance.ProjectCreateRight };
            }
            else
            {
                domainId = domainParameter.Value;
            }

            if (!IsAuthorised(domainId, rootMapId, heightenedRightRequirement))
            {
                throw new UnauthorizedAccessException("This user does not have the required privileges for this task.");
            }

            _session = new MapSession(this);
            _parameters = new MapParameters(this);
        }
コード例 #17
0
        public WebAppSPGlymaSession(string callingUrl, Guid sessionId, Guid? domainId, Guid? rootMapId, params IRight[] requiredRights)
        {
            _callingUrl = callingUrl;
            _sessionId = sessionId;

            if (!IsAuthorised(domainId, rootMapId, requiredRights))
            {
                throw new UnauthorizedAccessException("This user does not have the required privileges for this task.");
            }

            _session = new MapSession(this, _sessionId);

            _parameters = new MapParameters(this);
        }
コード例 #18
0
        public WebAppSPGlymaSession(string callingUrl)
        {
            _callingUrl = callingUrl;
            _sessionId = Guid.Empty;

            _session = new MapSession(this);
            _parameters = new MapParameters(this);
        }
コード例 #19
0
        public WebAppSPGlymaSession(string callingUrl, Guid sessionId)
        {
            _callingUrl = callingUrl;
            _sessionId = sessionId;

            _session = new MapSession(this, _sessionId);

            _parameters = new MapParameters(this);
        }