示例#1
0
 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!");
             }
         }
     }
 }
示例#2
0
    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);
                }
            }
        }
    }