[TASK] Added content + camera controller

This commit is contained in:
2019-08-25 23:58:48 +02:00
parent c8ab81a848
commit b4543142de
67 changed files with 1700 additions and 54 deletions

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Mapbox.Unity.Location;
using Mapbox.Unity.Utilities;
using Mapbox.Utils;
using UnityEngine;
public class GoldDuckEditorLocationProvider : AbstractEditorLocationProvider
{
[SerializeField] CollectableDuckData[] _ducks;
[SerializeField]
Vector2d _latitudeOffset = new Vector2d(0.0001, 0);
/// The mock heading value.
/// </summary>
[SerializeField]
[Range(0, 359)]
float _heading;
private int idx = -1;
Vector2d LatitudeLongitude
{
get
{
idx++;
// reset index to keep looping through the location array
if (idx >= _ducks.Length) { idx = 0; }
return _ducks[idx].LatitudeLongitude + _latitudeOffset;
}
}
protected override void SetLocation()
{
_currentLocation.UserHeading = _heading;
_currentLocation.LatitudeLongitude = LatitudeLongitude;
_currentLocation.Accuracy = _accuracy;
_currentLocation.Timestamp = UnixTimestampUtils.To(DateTime.UtcNow);
_currentLocation.IsLocationUpdated = true;
_currentLocation.IsUserHeadingUpdated = true;
}
}