void CheckConnectedInteractablesForSelf() { if (ConnectedInteractables != null && ConnectedInteractables.Count() > 0) { foreach (Interactable interactable in ConnectedInteractables) { if (gameObject.GetInstanceID() == interactable.gameObject.GetInstanceID()) { Debug.LogError("Switch: '" + gameObject + "' has itself as a connected interactable!"); } } } }
void OnDrawGizmos() { if (ConnectedInteractables != null && ConnectedInteractables.Count() > 0) { foreach (Interactable interactable in ConnectedInteractables) { if (interactable != null) { Gizmos.color = Color.blue; Gizmos.DrawWireSphere(transform.position, 0.2f); Gizmos.color = Color.green; Gizmos.DrawLine(transform.position, interactable.transform.position); } } } }