Files
MI-38/Heli_with_panels/Assets/Scripts/Panel2D/0509/AngleToNumber.cs
2022-07-04 13:15:35 +03:00

27 lines
629 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class AngleToNumber : MonoBehaviour
{
public Handler handle;//крутилка
public TextMeshPro number;//счетчик
private void Start()
{
handle = this.gameObject.GetComponent<Handler>();
}
private void LateUpdate()
{
if (handle.drag)
{
var k = handle.gameObject.transform.localEulerAngles.z;
int count = 9-(int)(handle.gameObject.transform.localEulerAngles.z / 36);
number.text = count.ToString();
}
}
}