[TASK] Initial commit with basic product setup

This commit is contained in:
2019-08-18 13:50:14 +02:00
commit 01a66a8e1f
2548 changed files with 167528 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
namespace Mapbox.Examples
{
using UnityEngine;
using Mapbox.Unity.Map;
using UnityEngine.UI;
public class LoadingPanelController : MonoBehaviour
{
[SerializeField]
GameObject _content;
[SerializeField]
Text _text;
[SerializeField]
AnimationCurve _curve;
AbstractMap _map;
void Awake()
{
_map = FindObjectOfType<AbstractMap>();
_map.OnInitialized += _map_OnInitialized;
}
void _map_OnInitialized()
{
var visualizer = _map.MapVisualizer;
_text.text = "LOADING";
visualizer.OnMapVisualizerStateChanged += (s) =>
{
if (this == null)
return;
if (s == ModuleState.Finished)
{
_content.SetActive(false);
}
else if (s == ModuleState.Working)
{
// Uncommment me if you want the loading screen to show again
// when loading new tiles.
//_content.SetActive(true);
}
};
}
void Update()
{
var t = _curve.Evaluate(Time.time);
_text.color = Color.Lerp(Color.clear, Color.white, t);
}
}
}