Exemple #1
0
 private void OnCablePickedUpByOther()
 {
     // Remove cable from socket.
     if (this.insertedCable != null)
     {
         this.insertedCable.SetConnection(null, null);
         this.insertedCable = null;
     }
 }
Exemple #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (this.insertedCable != null)
        {
            return;
        }

        // Atach cable to this socket.
        MoveableCableEnd cableEnd = other.GetComponent <MoveableCableEnd>();

        if (cableEnd != null)
        {
            if (cableEnd == this.insertedCable)
            {
                return;
            }

            this.insertedCable = cableEnd;
            this.insertedCable.Pickup(this.transform, Vector3.zero, false, false, this.OnCablePickedUpByOther);
            this.insertedCable.SetConnection(this.controllerUnit, this);
        }
    }
 private void InitialiseCableEnd(MoveableCableEnd cableEnd)
 {
     cableEnd.AddConnectionMadeCallback(this.OnConnectionMade);
     cableEnd.AddConnectionRemovedCallback(this.OnConnectionRemoved);
 }