using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using UnityEngine; public class IconMgr : MonoBehaviour { private static IconMgr instance; public static IconMgr Instance { get { if (instance == null) { GameObject obj = new GameObject("IconMgr"); instance = obj.AddComponent(); DontDestroyOnLoad(obj); } return instance; } } ///// ///// 地点 ///// //public GameObject location_tip; ///// ///// 空调 ///// //public GameObject cooler_tip; ///// ///// 照明 ///// //public GameObject lighting_tip; ///// ///// 排水 ///// //public GameObject drainage_tip; private void Awake() { //location_tip = GameObject.Find("地点名称tip"); //cooler_tip = GameObject.Find("空调tip"); //lighting_tip = GameObject.Find("照明tip"); //drainage_tip = GameObject.Find("排水tip"); } public void PerformOperation(int operationType) { switch (operationType) { case 1: Operation1(); break; case 2: Operation2(); break; case 3: Operation3(); break; case 4: Operation4(); break; case 5: Operation5(); break; case 6: Operation6(); break; case 7: Operation7(); break; case 8: Operation8(); break; default: Debug.LogError("Invalid operation type"); break; } } /// /// 地点名称 /// private void Operation1() { Debug.Log("Performing Operation 1"); //location_tip.SetActive(true); //cooler_tip.SetActive(false); //lighting_tip.SetActive(false); //drainage_tip.SetActive(false); Resetting(); Config.Instance.location_tip.SetActive(true); Config.Instance.cooler_tip.SetActive(false); Config.Instance.lighting_tip.SetActive(false); Config.Instance.drainage_tip.SetActive(false); } /// /// 空调 /// private void Operation2() { Debug.Log("Performing Operation 2"); //location_tip.SetActive(true); //cooler_tip.SetActive(true); //lighting_tip.SetActive(false); //drainage_tip.SetActive(false); Resetting(); Config.Instance.location_tip.SetActive(true); Config.Instance.cooler_tip.SetActive(true); Config.Instance.lighting_tip.SetActive(false); Config.Instance.drainage_tip.SetActive(false); } /// /// 照明 /// private void Operation3() { Debug.Log("Performing Operation 3"); //location_tip.SetActive(true); //cooler_tip.SetActive(false); //lighting_tip.SetActive(true); //drainage_tip.SetActive(false); Resetting(); Config.Instance.location_tip.SetActive(false); Config.Instance.cooler_tip.SetActive(false); Config.Instance.lighting_tip.SetActive(true); Config.Instance.drainage_tip.SetActive(false); Config.Instance.lighting_b1f.SetActive(false); Config.Instance.lighting_a1.SetActive(true); Config.Instance.lighting_a2.SetActive(false); Config.Instance.lighting_a3.SetActive(false); } /// /// 排水 /// private void Operation4() { Debug.Log("Performing Operation 4"); //location_tip.SetActive(true); //cooler_tip.SetActive(false); //lighting_tip.SetActive(false); //drainage_tip.SetActive(true); Resetting(); Config.Instance.location_tip.SetActive(true); Config.Instance.cooler_tip.SetActive(false); Config.Instance.lighting_tip.SetActive(false); Config.Instance.drainage_tip.SetActive(true); } /// /// 照明负一楼 /// private void Operation5() { Debug.Log("Performing Operation 5"); //location_tip.SetActive(true); //cooler_tip.SetActive(false); //lighting_tip.SetActive(false); //drainage_tip.SetActive(true); Config.Instance.location_tip.SetActive(false); Config.Instance.cooler_tip.SetActive(false); Config.Instance.lighting_tip.SetActive(true); Config.Instance.drainage_tip.SetActive(false); Config.Instance.lighting_b1f.SetActive(true); Config.Instance.lighting_a1.SetActive(false); Config.Instance.lighting_a2.SetActive(false); Config.Instance.lighting_a3.SetActive(false); } /// /// 照明一楼 /// private void Operation6() { Debug.Log("Performing Operation 6"); //location_tip.SetActive(true); //cooler_tip.SetActive(false); //lighting_tip.SetActive(false); //drainage_tip.SetActive(true); Config.Instance.location_tip.SetActive(false); Config.Instance.cooler_tip.SetActive(false); Config.Instance.lighting_tip.SetActive(true); Config.Instance.drainage_tip.SetActive(false); Config.Instance.lighting_b1f.SetActive(false); Config.Instance.lighting_a1.SetActive(true); Config.Instance.lighting_a2.SetActive(false); Config.Instance.lighting_a3.SetActive(false); } /// /// 照明二楼 /// private void Operation7() { Debug.Log("Performing Operation 7"); //location_tip.SetActive(true); //cooler_tip.SetActive(false); //lighting_tip.SetActive(false); //drainage_tip.SetActive(true); Config.Instance.location_tip.SetActive(false); Config.Instance.cooler_tip.SetActive(false); Config.Instance.lighting_tip.SetActive(true); Config.Instance.drainage_tip.SetActive(false); Config.Instance.lighting_b1f.SetActive(false); Config.Instance.lighting_a1.SetActive(false); Config.Instance.lighting_a2.SetActive(true); Config.Instance.lighting_a3.SetActive(false); } /// /// 照明三楼 /// private void Operation8() { Debug.Log("Performing Operation 8"); //location_tip.SetActive(true); //cooler_tip.SetActive(false); //lighting_tip.SetActive(false); //drainage_tip.SetActive(true); Config.Instance.location_tip.SetActive(false); Config.Instance.cooler_tip.SetActive(false); Config.Instance.lighting_tip.SetActive(true); Config.Instance.drainage_tip.SetActive(false); Config.Instance.lighting_b1f.SetActive(false); Config.Instance.lighting_a1.SetActive(false); Config.Instance.lighting_a2.SetActive(false); Config.Instance.lighting_a3.SetActive(true); } /// /// 初始状态 /// private void Resetting() { foreach (Transform child in Config.Instance.location_tip.transform) { child.gameObject.SetActive(false); } foreach (Transform child in Config.Instance.cooler_tip.transform) { child.gameObject.SetActive(false); } Config.Instance.drainage_Pop.SetActive(false); Config.Instance.lighting_Pop.SetActive(false); } }