private void Start()
    {
        _showBoundingBox = false;

        _isBeingTrackedWindTarget        = VuforiaTools.IsBeingTracked("Wind Target");
        _isBeingTrackedSceneTarget       = VuforiaTools.IsBeingTracked("Scene Target");
        _isBeingTrackedTemperatureTarget = VuforiaTools.IsBeingTracked("Temperature Target");

        _terrain         = GameObject.Find("Terrain");
        _windKnob        = GameObject.Find("Wind Knob");
        _temperatureKnob = GameObject.Find("Temperature Knob");

        var button = HelpButton.GetComponent <Button>();

        button.onClick.AddListener(HelpButtonClicked);
    }
    private void UpdateWindForce()
    {
        bool isBeingTracked = VuforiaTools.IsBeingTracked("Wind Target");

        if (isBeingTracked)
        {
            var targetAngle = _windTargetTransform.localRotation.eulerAngles.y;

            var mappedAngle = Map(targetAngle, 0, 280, 0, 50);

            if (_lastWindForceFromTarget != mappedAngle && targetAngle <= 280)
            {
                WindForce = mappedAngle;

                _lastWindForceFromTarget = WindForce;

                _windTextManager.UpdatePanelText(WindForce);
                _windTextManager.UpdateTargetText(WindForce);
            }
        }
    }
Esempio n. 3
0
    private void UpdateTemperature()
    {
        bool isBeingTracked = VuforiaTools.IsBeingTracked("Temperature Target");

        if (isBeingTracked)
        {
            var targetAngle = _temperatureTargetTransform.localRotation.eulerAngles.y;

            var mappedAngle = Map(targetAngle, 0, 280, 0, 50);

            if (_lastTempFromTarget != mappedAngle && targetAngle < 280)
            {
                Temperature = mappedAngle;

                TargetTemperature = Temperature;

                _lastTempFromTarget = Temperature;

                _temperatureTextManager.UpdateTargetText(TargetTemperature);
                _temperatureTextManager.UpdatePanelText(Temperature);
            }
        }
    }
 private void Update()
 {
     _isBeingTrackedWindTarget        = VuforiaTools.IsBeingTracked("Wind Target");
     _isBeingTrackedSceneTarget       = VuforiaTools.IsBeingTracked("Scene Target");
     _isBeingTrackedTemperatureTarget = VuforiaTools.IsBeingTracked("Temperature Target");
 }