private void RemoveNearbyMessage(NearbyMessage message)
    {
        var nearbyMessageObject = _nearbyMessagesPrefabs[message.Id];

        Destroy(nearbyMessageObject);
        _nearbyMessagesPrefabs.Remove(message.Id);
    }
        internal void NearbyDeviceAdded(NearbyVirtualDevice device)
        {
            var message = new NearbyMessage(device);

            _nearbyMessages[message.Id] = message;
            NotifyMessageFound(message);
        }
Exemple #3
0
 private void OnSceneOutOfRange(NearbyMessage message)
 {
     if (message.Content != _currentPlace)
     {
         return;
     }
     Hide();
 }
 public void SetNearbyMessage(NearbyMessage message)
 {
     DisplayMsgContent(message.Content);
     DisplayMsgNamespace(message.Namespace);
     DisplayMsgType(message.Type);
     DisplayMsgDistance(message.DistanceMeters, message.DistanceAccuracy);
     DisplayMsgSignal(message.SignalRssi, message.SignalTx);
 }
    private void RenderNearbyMessage(NearbyMessage message)
    {
        var prefabInstance = Instantiate(nearbyMessagePrefab, nearbyMessagesContainer.transform);

        _nearbyMessagesPrefabs.Add(message.Id, prefabInstance);

        UpdateNearbyMessage(message);
    }
        private void MutateDevice(NearbyMessage message)
        {
            message.UpdateDistance(_random.NextDouble() * 500, _random.Next(1, 100));
            message.UpdateSignal(_random.Next(-127, 127), _random.Next(-127, 127));

            NotifyDistanceChanged(message);
            NotifySignalChanged(message);
        }
 private void OnPlaceNearby(NearbyMessage message)
 {
     Hide();
     GameState.Instance.currentPlace = message.Content;
     SceneManager.LoadScene(sceneToLoad);
 }
    private void UpdateNearbyMessage(NearbyMessage message)
    {
        var nearbyMessageObject = _nearbyMessagesPrefabs[message.Id];

        nearbyMessageObject.GetComponent <MessageInfo>().SetNearbyMessage(message);
    }
        private void NotifySignalChanged(NearbyMessage message)
        {
            var encodedMessage = $"{message.Content}<[]>{message.Namespace}<[]>{message.Type}<[]>{message.SignalRssi}<[]>{message.SignalTx}";

            Notify(OnSignalChanged, encodedMessage);
        }
        private void NotifyDistanceChanged(NearbyMessage message)
        {
            var encodedMessage = $"{message.Content}<[]>{message.Namespace}<[]>{message.Type}<[]>{message.DistanceMeters}<[]>{message.DistanceAccuracy}";

            Notify(OnDistanceChanged, encodedMessage);
        }
        private void NotifyMessageFound(NearbyMessage message)
        {
            var encodedMessage = $"{message.Content}<[]>{message.Namespace}<[]>{message.Type}";

            Notify(OnMessageFound, encodedMessage);
        }