using UnityEngine.UI; using UnityEngine; using System.Collections.Generic; public class Get : MonoBehaviour { public static int MaxObjectCount => 299; public static string TogOn(string Oname) { string Togname = null; GameObject O = Get.o1(Oname); for (int i = 0; i < O.transform.childCount; i++) { if (O.transform.GetChild(i).GetComponent().isOn) { return O.transform.GetChild(i).gameObject.name; } } return null; } public static GameObject o1(string O1){ if(GameObject.Find(O1))return GameObject.Find(O1); return null; } public static GameObject o2(string O1,string O2){ GameObject O = null; if (GameObject.Find(O1) != null) { O = GameObject.Find(O1); if (O.transform.Find(O2) != null) { O = O.transform.Find(O2).gameObject; } else { O = null; } } return O; } public static GameObject o3(string O1,string O2,string O3){ return GameObject.Find(O1).transform.Find(O2).transform.Find(O3).gameObject; } public static GameObject o4(string O1,string O2,string O3,string O4){ return GameObject.Find(O1).transform.Find(O2).transform.Find(O3).transform.Find(O4).gameObject; } public static GameObject o5(string O1,string O2,string O3,string O4,string O5){ return GameObject.Find(O1).transform.Find(O2).transform.Find(O3).transform.Find(O4).transform.Find(O5).gameObject; } public static int GetObjectIndex(string On) { if (On.Length > 4 && On != "sfloor" && On != "sceil") { return int.Parse(On[4..]); } Debug.Log($"object number not found : {On}"); return MaxObjectCount; } public static bool Active(string Oname) {//Imput Value float bool ONOFF = false; if (GameObject.Find("HIDER").transform.Find(Oname).gameObject.activeInHierarchy) ONOFF = true; return ONOFF; } public static bool Exist(string papa, string child) {//Imput Value float bool ONOFF = false; if (GameObject.Find(papa).transform.Find(child).gameObject.activeInHierarchy) ONOFF = true; return ONOFF; } public static bool ExistActif(string O) {//Imput Value float bool ONOFF = false; if (GameObject.Find("Canvas")) { if (GameObject.Find("Panel_SCENE")) { if (GameObject.Find("PNL_TAB")) { if (GameObject.Find(O)) { ONOFF = true; } } } } return ONOFF; } public static bool Bool(string Target,string List){ string[] Items=List.Split('_'); for(int i=0; i