Exemple #1
0
    public bool DetachAny()
    {
        if (!HasAttachment())
        {
            Debug.LogWarning("Failed to detach any object, because nothing is attached...");
            return(false);
        }

        if (IsClaimed())
        {
            Debug.LogWarning("Could not detach object from tile, because it is claimed by another tile, only the claimant can detach the attachment...");
            return(false);
        }

        IAttachment attachment = this.attachment;

        this.attachment = null;
        attachment.OnDetached(this);
        return(true);
    }