Unity: No more detect Closest enemy info. Add different density sensor let agent get more state information on the center of view. Adjust Start Scene UI manager. Add in game visible rayCast & information that rayCast detect. Python: Start use mypy black and flake8 to format Python.
26 lines
688 B
C#
26 lines
688 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
|
|
public class rayInfoUI : MonoBehaviour
|
|
{
|
|
TextMeshProUGUI infoText;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
infoText = transform.GetChild(0).gameObject.GetComponent<TextMeshProUGUI>();
|
|
}
|
|
|
|
public void updateInfo(string info,Vector3 infoPosition, Color infoColor)
|
|
{
|
|
infoText.text = info;
|
|
infoText.color = infoColor;
|
|
transform.position = infoPosition;
|
|
Vector3 v = Camera.main.transform.position - infoPosition;
|
|
v.x = v.z = 0.0f;
|
|
transform.LookAt(Camera.main.transform.position - v);
|
|
transform.Rotate(0, 180, 0);
|
|
}
|
|
}
|