예제 #1
0
    private void OnCollisionEnter(Collision collision)
    {
        InteractiveObjectController otherObject = collision.gameObject.GetComponent <InteractiveObjectController>();

        if (otherObject && otherObject.attached)
        {
            AttachmentPointController otherAttachment = otherObject.parentAttachmentPoint;
            otherObject.Detach();
            otherAttachment.Deactivate();
        }
    }
예제 #2
0
    private void OnTriggerEnter(Collider other)
    {
        InteractiveObjectController otherObject = other.GetComponent <InteractiveObjectController>();

        if (otherObject && otherObject.attached && otherObject.breakMomentum <= GetMomentum())
        {
            AttachmentPointController otherAttachment = otherObject.parentAttachmentPoint;
            otherObject.Detach();
            otherAttachment.Deactivate();
        }
    }