コード例 #1
0
    // Update the slot details
    public void Update(Slot slot)
    {
        _slot = slot;

        // slot data has an attachment
        if (_slot != null && _slot.Attachment != null)
        {
            // we already have an attachment, make sure it's visible and update with new slot data.
            if (_attachment != null)
            {
                _attachment.isVisible = true;
                _attachment.Update(_slot);

                // else we do not have an attachment already set
            }
            else
            {
                _attachment = new GSpineAttachment(_slot);
                AddChild(_attachment);
            }

            // slot is empty
        }
        else
        {
            // we currently have an attachment, so hide it
            if (_attachment != null)
            {
                _attachment.isVisible = false;
            }
        }
    }
コード例 #2
0
    // Update the slot details
    public void Update(Slot slot)
    {
        _slot = slot;

        // slot data has an attachment
        if(_slot != null && _slot.Attachment != null){

            // we already have an attachment, make sure it's visible and update with new slot data.
            if(_attachment != null){
                _attachment.isVisible = true;
                _attachment.Update(_slot);

            // else we do not have an attachment already set
            }else{
                _attachment = new GSpineAttachment(_slot);
                AddChild(_attachment);
            }

        // slot is empty
        }else{

            // we currently have an attachment, so hide it
            if(_attachment != null){
                _attachment.isVisible = false;
            }
        }
    }