Exemple #1
0
    public bool Attach(IAttachment attachment)
    {
        if (IsClaimed())
        {
            Debug.LogWarning("Could not attach object to tile, because it is already claimed by another claimant...");
            return(false);
        }

        if (HasAttachment())
        {
            Debug.LogWarning("Failed to attach object to tile, because it is already occupied...");
            return(false);
        }

        //GameObject go = Instantiate(attachmentPrefab);
        //go.transform.SetParent(transform);
        //go.transform.localPosition = Vector3.zero;
        //ITileAttachment attachment = go.GetComponent(typeof(ITileAttachment)) as ITileAttachment;
        this.attachment = attachment;
        attachment.OnAttached(this);
        return(true);
    }