Пример #1
0
    /// <summary>
    /// Raises the tooltip event.
    /// </summary>
    /// <param name="show">If set to <c>true</c> show.</param>
    public override void OnTooltip(bool show)
    {
        if (show && this.IsAssigned())
        {
            // Show the tooltip
            RnMUI_ItemSlot.ShowTooltip(this.itemInfo, this.iconSprite as UIWidget);

            // Prevent hide
            return;
        }
        else if (show && !this.IsAssigned())
        {
            RnMUI_Tooltip.SetTitle(this.EquipTypeToString());

            // Set the tooltip position
            RnMUI_Tooltip.SetPosition(this.iconSprite as UIWidget);

            // Show the tooltip
            RnMUI_Tooltip.Show();

            // Prevent hide
            return;
        }

        // Default hide
        RnMUI_Tooltip.Hide();
    }
Пример #2
0
    /// <summary>
    /// Raises the tooltip event.
    /// </summary>
    /// <param name="show">If set to <c>true</c> show.</param>
    public override void OnTooltip(bool show)
    {
        if (show && this.IsAssigned())
        {
            // Show the tooltip
            RnMUI_ItemSlot.ShowTooltip(this.itemInfo, this.iconSprite as UIWidget);

            // Prevent hide
            return;
        }

        // Default hide
        RnMUI_Tooltip.Hide();
    }
Пример #3
0
    public void OnDragOver(GameObject go)
    {
        if (this.hintLabel == null)
        {
            return;
        }

        RnMUI_ItemSlot slot = go.GetComponent <RnMUI_ItemSlot>();

        // If we are dragging an item
        if (slot != null)
        {
            this.SetLabelAlpha(1f);
        }
    }
Пример #4
0
    void Start()
    {
        if (this.slot == null)
        {
            this.slot = this.GetComponent <RnMUI_ItemSlot>();
        }

        if (this.slot == null || this.itemDatabase == null)
        {
            this.Destruct();
            return;
        }

        this.slot.Assign(this.itemDatabase.GetByID(this.assignItem));
        this.Destruct();
    }
Пример #5
0
    /// <summary>
    /// Assign the slot by the passed source slot.
    /// </summary>
    /// <param name="source">Source.</param>
    public override bool Assign(Object source)
    {
        if (source is RnMUI_ItemSlot)
        {
            RnMUI_ItemSlot sourceSlot = source as RnMUI_ItemSlot;

            if (sourceSlot != null)
            {
                // Check if the equipment type matches the target slot
                if (!this.CheckEquipType(sourceSlot.GetItemInfo()))
                {
                    return(false);
                }

                return(this.Assign(sourceSlot.GetItemInfo()));
            }
        }
        else if (source is RnMUI_EquipSlot)
        {
            RnMUI_EquipSlot sourceSlot = source as RnMUI_EquipSlot;

            if (sourceSlot != null)
            {
                // Check if the equipment type matches the target slot
                if (!this.CheckEquipType(sourceSlot.GetItemInfo()))
                {
                    return(false);
                }

                // Type matches
                return(this.Assign(sourceSlot.GetItemInfo()));
            }
        }

        // Default
        return(false);
    }
Пример #6
0
    /// <summary>
    /// Assign the slot by the passed source slot.
    /// </summary>
    /// <param name="source">Source.</param>
    public override bool Assign(Object source)
    {
        if (source is RnMUI_ItemSlot)
        {
            RnMUI_ItemSlot sourceSlot = source as RnMUI_ItemSlot;

            if (sourceSlot != null)
            {
                return(this.Assign(sourceSlot.GetItemInfo()));
            }
        }
        else if (source is RnMUI_EquipSlot)
        {
            RnMUI_EquipSlot sourceSlot = source as RnMUI_EquipSlot;

            if (sourceSlot != null)
            {
                return(this.Assign(sourceSlot.GetItemInfo()));
            }
        }

        // Default
        return(false);
    }