add project files
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
public class UIDisplayOnTouch : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private CoreDef CoreDef;
|
||||
|
||||
[SerializeField]
|
||||
[FormerlySerializedAs("humanHandAnim")]
|
||||
private Animator _humanHandAnim;
|
||||
|
||||
private bool _isShown;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_isShown = false;
|
||||
_humanHandAnim.SetBool("IsVisible", value: false);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
bool visible = false;
|
||||
if (CoreDef.showHumanHand)
|
||||
{
|
||||
visible = Input.GetMouseButton(0);
|
||||
_humanHandAnim.transform.position = Input.mousePosition;
|
||||
}
|
||||
if (_isShown != visible)
|
||||
{
|
||||
_humanHandAnim.SetBool("IsVisible", visible);
|
||||
_isShown = visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user