using EPOOutline; using System.Collections; using System.Collections.Generic; using UnityEngine; public class ModelItem : MonoBehaviour { public Outlinable outlinable; private void Awake() { AddMeshColliders(); outlinable = this.GetComponent(); } public void AddMeshColliders() { MeshRenderer[] meshRenderers = GetComponentsInChildren(); foreach (var item in meshRenderers) { if (item.GetComponent() == null) { item.gameObject.AddComponent(); } } } public void AddOutLinable() { if (outlinable == null) { outlinable = this.GetComponent() == null ? this.gameObject.AddComponent() : this.GetComponent(); outlinable.AddAllChildRenderersToRenderingList(); } outlinable.enabled = false; } public void OpenHighlighter() { if (outlinable == null) { outlinable = this.GetComponent() == null ? this.gameObject.AddComponent() : this.GetComponent(); outlinable.AddAllChildRenderersToRenderingList(); } outlinable.enabled = true; OutLineManager.Instance.ResetOutLinableByType(outlinable, OutLineType.hint); } public void CloseHighlighter() { outlinable.enabled = false; } }