44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PlayerUI : MonoBehaviour
|
|
{
|
|
public GameObject TargetConObj;
|
|
public GameObject ParamaObj;
|
|
public TextMeshProUGUI targetText;
|
|
public TextMeshProUGUI inareaText;
|
|
private TargetController targetController;
|
|
private ParameterContainer parameterContainer;
|
|
|
|
private void Start()
|
|
{
|
|
targetController = TargetConObj.GetComponent<TargetController>();
|
|
parameterContainer = ParamaObj.GetComponent<ParameterContainer>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
int tType = targetController.targetTypeInt;
|
|
targetText.text = Enum.GetName(typeof(TargetController.Targets), tType);
|
|
if(tType == (int)TargetController.Targets.Go)
|
|
{
|
|
if (parameterContainer.agentInArea == 1)
|
|
{
|
|
inareaText.text = "In!";
|
|
}
|
|
else
|
|
{
|
|
inareaText.text = "nah";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
inareaText.text = "nah";
|
|
}
|
|
}
|
|
}
|