using System.Collections.Generic; using Sirenix.OdinInspector; using UnityEngine; namespace UnityTest.ZXL { public class ObjectDataComponent : BaseAutoMono { public List objectData = new List(); public List highlightObjectData = new List(); public Dictionary objectComponents = new Dictionary(); public GameObject GetObject(HighlightObjectType objectType) { var key = objectType.ToString(); if (objectComponents.TryGetValue(key, out ObjectComponent component)) { return component.gameObject; } return null; } } [System.Serializable] public struct ObjectData { public string goName; public GameObject go; } public enum HighlightObjectType { 乙炔气瓶开关, 电脑屏幕, 湿抹布, 警示牌, 应急处理表, } }