PKIT_AutonomousCars/Assets/Scripts/ObjectSelection.cs
Abdul Mukheem Shaik 35fcbc1e24 initial commit
2024-11-06 18:38:19 +01:00

52 lines
1.2 KiB
C#

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