private ISpatialAnchor Create(SpatialAnchorID anchorID) { ISpatialAnchor anchor = _anchorFactory.Create(anchorID); AddAnchor(anchorID, anchor); return(anchor); }
private ISpatialAnchor Find(SpatialAnchorID anchorID) { if (_database.ContainsKey(anchorID)) { return(_database[anchorID]); } return(null); }
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); }
private ISpatialAnchor CreateAnchor(PlayerID playerID) { SpatialAnchorID anchorID = CreateNewID(playerID); _database.Add(playerID, anchorID); ISpatialAnchor anchor = _anchorRepository.Create(anchorID); OnCreatedAnchor?.Invoke(anchor); return(anchor); }
ISpatialAnchor ISpatialAnchorRepository.Find(SpatialAnchorID anchorID) => Find(anchorID);
ISpatialAnchor ISpatialAnchorRepository.Create(SpatialAnchorID anchorID) => Create(anchorID);
private void Contruct(SpatialAnchorID anchorID) { _anchorID = anchorID; name = _anchorID.ToString(); }