Beispiel #1
0
    private void OnTriggerEnter(Collider collider)
    {
        //if (_isInInteractiveZone) return;

        if (CurrentZone == null) //If null there is first zone entered
        {
            _lastZoneEnterTime = DateTime.Now;
            CurrentZone        = collider.gameObject.transform.parent.GetComponent <InteractiveZone>();
            _lastZoneName      = CurrentZone.Name;

            NotificationManager.SendWithAppIcon(TimeSpan.Zero, CurrentZone.Name + " is near!",
                                                CurrentZone.Description, Color.black);
        }
        else
        {
            TimeSpan timeFromLastZone = DateTime.Now.Subtract(_lastZoneEnterTime);
            CurrentZone = collider.gameObject.transform.parent.GetComponent <InteractiveZone>();

            Debug.Log(timeFromLastZone.TotalSeconds);

            if (timeFromLastZone.TotalSeconds > _pushMessageDelay || CurrentZone.Name != _lastZoneName)
            {
                NotificationManager.SendWithAppIcon(TimeSpan.Zero, CurrentZone.Name + " is near!",
                                                    CurrentZone.Description, Color.black);
            }

            _lastZoneEnterTime = DateTime.Now;
            _lastZoneName      = CurrentZone.Name;
        }

        MainController.Instance.SetOnButton(true);
        _isInInteractiveZone = true;
    }
 public void CopyZoneInfo(InteractiveZone zone)
 {
     Id          = zone.Id;
     Name        = zone.Name;
     Latitude    = zone.Latitude;
     Longtitude  = zone.Longtitude;
     Rotation    = zone.Rotation;
     Description = zone.Description;
     ModelLink   = zone.ModelLink;
     TextureLink = zone.TextureLink;
 }
    private void SpawnInteractiveZone(InteractiveZone zoneInfo)
    {
        Vector3 targetPos = Conversions.GeoToWorldPosition(
            zoneInfo.Latitude,
            zoneInfo.Longtitude,
            _map.CenterMercator,
            _map.WorldRelativeScale).ToVector3xz();

        GameObject      tmp     = (GameObject)Instantiate(InteractiveZonePrefab, targetPos, Quaternion.Euler(0f, zoneInfo.Rotation, 0f));
        InteractiveZone newZone = tmp.GetComponent <InteractiveZone>();

        newZone.CopyZoneInfo(zoneInfo);
    }
Beispiel #4
0
    public void TurnModelOn()
    {
        InteractiveZone interactiveZone = Player.Instance.CurrentZone;

        ARCamera.SetActive(true);
        MainCamera.SetActive(false);
        ButtonOnModels.SetActive(false);
        ButtonOffModels.SetActive(true);
        CameraTexture.SetActive(true);
        InfoAboutModels.text = interactiveZone.Description;

        _objReader._textFieldString = interactiveZone.ModelLink;
        _objReader._textureLink     = interactiveZone.TextureLink;

        _objReader.StartCoroutine(_objReader.SomeFunction("Object for Model"));
    }