using UnityEngine; public class CrabInteract : InteractHandler { public GameObject commandUIPrefab; public LogManager logman; private GameObject currentUI; void Start() { logman = FindObjectOfType(); } public override void InteractLogic() { if (currentUI == null) { currentUI = Instantiate(commandUIPrefab); currentUI.GetComponent().crab = GetComponent(); logman.SetCrabInterface(commandUIPrefab.GetComponent()); } logman.ToggleLogMenu(true); base.InteractLogic(); interactable = true; } }