예제 #1
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "Wire" && !m_wire) {
         m_wire = col.gameObject.GetComponent<SnippableWire>();
         m_wire.setIsHighlighted(true);
     }
 }
예제 #2
0
 void OnTriggerExit(Collider col)
 {
     if (m_wire && col.gameObject == m_wire.gameObject)
     {
         m_wire.setIsHighlighted(false);
         m_wire = null;
     }
 }
예제 #3
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "Wire" && !m_wire)
     {
         m_wire = col.gameObject.GetComponent <SnippableWire>();
         m_wire.setIsHighlighted(true);
     }
 }
예제 #4
0
    void OnTriggerExit(Collider col)
    {
        if (m_wire && col.gameObject == m_wire.gameObject) {

            m_wire.setIsHighlighted(false);
            m_wire = null;
        }
    }
 /// <summary>Attaches this instance to the specified <see cref="SnippableWire"/>, allowing events to be received from the wire.</summary>
 public void Attach(SnippableWire wire) => wire.ParentComponent = this;