28 lines
681 B
C#
28 lines
681 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Zenject;
|
|
using DG.Tweening;
|
|
using UltraFace;
|
|
|
|
public class MirrorAnimationHandler : MonoBehaviour
|
|
{
|
|
[Inject] private Visualizer _visualizer;
|
|
[SerializeField] private Material _material;
|
|
[SerializeField] private Color _baseColor;
|
|
|
|
private void Start() {
|
|
_material.color = Color.white;
|
|
}
|
|
|
|
public void Init()
|
|
{
|
|
_material.DOColor(_baseColor, .2f);
|
|
_visualizer.OnDetectionStatusChanged += isDetected =>
|
|
{
|
|
if(isDetected) _material.DOColor(Color.white, .5f);
|
|
else _material.DOColor(_baseColor, .5f);
|
|
};
|
|
}
|
|
}
|