示例#1
0
    public int PlaceTab(CardDefinition def, float localTime)
    {
        for (int i = 0; i < tabList.Length; i++)
        {
            if (tabList[i] == null)
            {
                continue;
            }
            if (tabList[i].definition.GetHashCode() == def.GetHashCode())
            {
                return(-1);
            }
        }
        int slot = nextAvailableIndex(def.cost, LocalTimeToSlot(localTime));

        if (slot == -1)
        {
            return(-1);
        }
        SkillTab tab = Instantiate(tabPrefab, transform);

        tab.Load(def);
        MoveToSlot(tab, slot);
        // Timey Whimy Stuff
        //GameManager.time = SlotToGT(slot) - 0.2f;

        return(slot);
    }
示例#2
0
 public override int GetHashCode()
 {
     return(CardDefinition.GetHashCode());
 }