Пример #1
0
        private ISpatialAnchor Create(SpatialAnchorID anchorID)
        {
            ISpatialAnchor anchor = _anchorFactory.Create(anchorID);

            AddAnchor(anchorID, anchor);

            return(anchor);
        }
Пример #2
0
        private ISpatialAnchor Find(SpatialAnchorID anchorID)
        {
            if (_database.ContainsKey(anchorID))
            {
                return(_database[anchorID]);
            }

            return(null);
        }
Пример #3
0
        private void AddAnchor(SpatialAnchorID anchorID, ISpatialAnchor anchor)
        {
            if (Find(anchorID) != null)
            {
                Debug.LogWarning($"{anchorID} is already exist in the database. The anchor won't be added this time.");
                return;
            }

            _database.Add(anchorID, anchor);
        }
Пример #4
0
        private ISpatialAnchor CreateAnchor(PlayerID playerID)
        {
            SpatialAnchorID anchorID = CreateNewID(playerID);

            _database.Add(playerID, anchorID);

            ISpatialAnchor anchor = _anchorRepository.Create(anchorID);

            OnCreatedAnchor?.Invoke(anchor);

            return(anchor);
        }
Пример #5
0
 ISpatialAnchor ISpatialAnchorRepository.Find(SpatialAnchorID anchorID) => Find(anchorID);
Пример #6
0
 ISpatialAnchor ISpatialAnchorRepository.Create(SpatialAnchorID anchorID) => Create(anchorID);
Пример #7
0
        private void Contruct(SpatialAnchorID anchorID)
        {
            _anchorID = anchorID;

            name = _anchorID.ToString();
        }