using System.Collections.Generic; using HighlightPlus; using UnityEngine; public class HDRPOutlineMgr: MonoBehaviour { public static HDRPOutlineMgr Ins { get; private set; } [SerializeField] private HighlightProfile outlineProfile; [SerializeField] private Color outlineColor = Color.yellow; private static Dictionary> highlightEvents = new Dictionary>(); void Awake() { Ins = this; } public static void StartHighlight(GameObject go) { var script = go.GetComponent(); if (script == null) { script = go.AddComponent(); } script.ProfileLoad(Ins.outlineProfile); script.highlighted = true; script.UpdateMaterialProperties(); } public static void StopHighlight(GameObject go) { HighlightEffect outline = go.GetComponent(); // Debug.Log ("StopHighlight: " + go.name + " / script: " + script); if (outline == null) return; GameObject.DestroyImmediate(outline); } }