You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
862 B
C#
40 lines
862 B
C#
3 months ago
|
using System;
|
||
|
using D2D.Utilities;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace D2D.UI
|
||
|
{
|
||
|
public class Dot : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField] private GameObject _onBody;
|
||
|
[SerializeField] private GameObject _offBody;
|
||
|
|
||
|
private float _timeSinceStart;
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
_timeSinceStart = Time.time;
|
||
|
}
|
||
|
|
||
|
public bool IsFilled
|
||
|
{
|
||
|
set
|
||
|
{
|
||
|
_onBody.SetActive(value);
|
||
|
_offBody.SetActive(!value);
|
||
|
|
||
|
if (Time.time - _timeSinceStart < .1f)
|
||
|
return;
|
||
|
|
||
|
if (value)
|
||
|
{
|
||
|
_onBody.transform.PunchUI();
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
_offBody.transform.PunchUI();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|