Ejemplo n.º 1
0
    public void Switch(LockCheck other)
    {
        mySet.ownsLockedObject = false;

        var tempParent = other.transform.parent;
        var tempSet    = other.mySet;

        other.transform.parent               = transform.parent;
        other.mySet                          = mySet;
        other.mySet.myObjects[sectionId]     = other.GetComponent <VisibilityCheck>();
        other.mySet.myLockObjects[sectionId] = other;

        transform.parent = tempParent;
        mySet            = tempSet;
        mySet.myLockObjects[sectionId] = this;
        mySet.myObjects[sectionId]     = GetComponent <VisibilityCheck>();
    }