Files
RatStabber/Assets/UI overlay/DistanceIndicator.cs
ProtoSharkk 23bab7a3e1 Distance indicator prefab and script
White circle with radius player.swingDistance
2024-10-22 01:17:02 -07:00

20 lines
600 B
C#

using UnityEngine;
public class DistanceIndicator : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
Teo player = GameObject.FindGameObjectWithTag("Player").GetComponent<Teo>();
RectTransform rect = GetComponent<RectTransform>();
rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, player.swingDistance*2);
rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, player.swingDistance*2);
}
// Update is called once per frame
void Update()
{
}
}