private bool checkIfGameObjectIsInteractible(GameObject checkMe) { BasicNPCInteractionScript bco = checkMe.GetComponentInChildren <BasicNPCInteractionScript>(); if (bco is IInteractible) { return(true); } else { return(false); } }
private void executeSingleInteractible(GameObject executeMe) { if (!checkIfGameObjectIsInteractible(executeMe)) { return; } else { BasicNPCInteractionScript bco = executeMe.GetComponentInChildren <BasicNPCInteractionScript>(); if (bco is IInteractible) { ((IInteractible)bco).DoInteract(gameObject); } else { return; } } }