27 lines
771 B
C#
27 lines
771 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
[RequireComponent(typeof(RobotController))]
|
|
public class RobotSelector : MonoBehaviour, IPointerClickHandler
|
|
{
|
|
private RobotController robotController;
|
|
|
|
private void Start()
|
|
{
|
|
robotController = GetComponent<RobotController>();
|
|
}
|
|
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
{
|
|
Debug.Log("RobotSelector OnPointerClick called.");
|
|
if (RobotManager.Instance != null && robotController != null)
|
|
{
|
|
RobotManager.Instance.SelectRobot(robotController.robotId);
|
|
Debug.Log(robotController.robotId + " Ŭ¸¯");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("RobotManager Instance or RobotController is null.");
|
|
}
|
|
}
|
|
} |