[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,40 @@
namespace Mapbox.Examples
{
using UnityEngine;
using System.Collections.Generic;
public class HighlightFeature : MonoBehaviour
{
static Material _highlightMaterial;
private List<Material> _materials = new List<Material>();
MeshRenderer _meshRenderer;
void Start()
{
if (_highlightMaterial == null)
{
_highlightMaterial = Instantiate(GetComponent<MeshRenderer>().material);
_highlightMaterial.color = Color.red;
}
_meshRenderer = GetComponent<MeshRenderer>();
foreach (var item in _meshRenderer.sharedMaterials)
{
_materials.Add(item);
}
}
public void OnMouseEnter()
{
_meshRenderer.sharedMaterial = _highlightMaterial;
}
public void OnMouseExit()
{
_meshRenderer.materials = _materials.ToArray();
}
}
}