public MarkerInstance move(Guid id, Vector3 location) { MarkerInstance instance = get(id); instance.SetLocation(location); return(instance); }
public Guid remove(Guid id) { MarkerInstance instance = get(id); Destroy(instance.GameObject); Instances.Remove(id); return(id); }
public MarkerInstance get(Guid id) { MarkerInstance instance = Instances[id]; if (instance != null) { return(instance); } throw new KeyNotFoundException("Could not find the instance"); }
public void place(float[] inputCoordinates, GameObject prefab = null) { if (prefab == null) { prefab = Prefab; } if (prefab != null) { RaycastHit hit = raycaster.getHit(inputCoordinates, LayerMask, MaxDistance, ViewCamera); GameObject gameObject = Instantiate(prefab, hit.point, Quaternion.identity); MarkerInstance instance = new MarkerInstance(gameObject, hit.point); Instances[instance.id] = instance; } }