AutonomousCars_HDRP/Assets/Scripts/ObjectSelectionSafe.cs
2024-11-19 15:04:33 +01:00

57 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static Unity.VisualScripting.Metadata;
public class ObjectSelectionSafe : MonoBehaviour
{
public GameObject unselectedArrow;
public GameObject selectedArrowAvoid;
public GameObject selectedArrowSafe;
public bool selected = false;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void selectUnSelectObject(GameObject currentGameObject)
{
if (selected == false)
{
selected = true;
unselectedArrow.SetActive(false);
selectedArrowSafe.SetActive(true);
}
else if (selected == true)
{
selected = false;
unselectedArrow.SetActive(true);
selectedArrowSafe.SetActive(false);
}
}
/* List<GameObject> foundObjects = new List<GameObject>();
GameObject[] allObjects = GameObject.FindObjectsOfType<GameObject>(true);
foreach (GameObject obj in allObjects)
{
if (obj.CompareTag("selectingSignifier"))
{
obj.SetActive(true);
}
}
*/
}