private void Awake() { if (instance == null) { instance = this; } else { throw new System.Exception("There cannot be more than on Inventory Menu instance, and this script can't be on anthing aside from the inventory menu"); } canvasGroup = GetComponent <CanvasGroup>(); firstPersonController = FindObjectOfType <FirstPersonController>(); interactWithLookedAt = FindObjectOfType <InteractWithLookedAt>(); }
private void Awake() { if (instance == null) { instance = this; } else { throw new System.Exception("There is already an instnace of InventoryMenu and there can only be one"); } canvasGroup = GetComponent <CanvasGroup>(); rigidbodyFirstPersonController = FindObjectOfType <RigidbodyFirstPersonController>(); interactWithLookedAt = FindObjectOfType <InteractWithLookedAt>(); audioSource = GetComponent <AudioSource>(); }