Ejemplo n.º 1
0
        /// <summary>
        /// Assign the specified slot by object.
        /// </summary>
        /// <param name="source">Source.</param>
        public virtual bool Assign(Object source)
        {
            if (source is UISlotBase)
            {
                UISlotBase sourceSlot = source as UISlotBase;

                if (sourceSlot != null)
                {
                    // Assign by sprite or texture
                    if (sourceSlot.GetIconSprite() != null)
                    {
                        return(this.Assign(sourceSlot.GetIconSprite()));
                    }
                    else if (sourceSlot.GetIconTexture() != null)
                    {
                        return(this.Assign(sourceSlot.GetIconTexture()));
                    }
                }
            }

            return(false);
        }