mirror of
https://github.com/lllyasviel/YGOProUnity_V2.git
synced 2026-10-27 21:45:02 +08:00
34 lines
865 B
C#
34 lines
865 B
C#
//----------------------------------------------
|
|
// NGUI: Next-Gen UI kit
|
|
// Copyright © 2011-2014 Tasharen Entertainment
|
|
//----------------------------------------------
|
|
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// A UI script that keeps an eye on the slot in character equipment.
|
|
/// </summary>
|
|
|
|
[AddComponentMenu("NGUI/Examples/UI Equipment Slot")]
|
|
public class UIEquipmentSlot : UIItemSlot
|
|
{
|
|
public InvEquipment equipment;
|
|
public InvBaseItem.Slot slot;
|
|
|
|
override protected InvGameItem observedItem
|
|
{
|
|
get
|
|
{
|
|
return (equipment != null) ? equipment.GetItem(slot) : null;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Replace the observed item with the specified value. Should return the item that was replaced.
|
|
/// </summary>
|
|
|
|
override protected InvGameItem Replace (InvGameItem item)
|
|
{
|
|
return (equipment != null) ? equipment.Replace(slot, item) : item;
|
|
}
|
|
} |