Beispiel #1
0
 public void RemoveKey(Key.Type keyType)
 {
     for (int i = 0; i < keys.Count; i++)
     {
         if (keys[i].t == keyType)
         {
             keys.RemoveAt(i);
         }
     }
 }
Beispiel #2
0
 public bool HasKey(Key.Type keyType)
 {
     for (int i = 0; i < keys.Count; i++)
     {
         if (keys[i].t == keyType)
         {
             return(true);
         }
     }
     return(false);
 }
    public bool UseKey(Key.Type keyType)
    {
        //If there exist the type of key in inventory
        if (m_keys[(int)keyType] == true)
        {
            //Use the key and return true
            m_keys[(int)keyType] = false;
            m_inventoryUI.ShowKeyUI((int)keyType, false);
            return(true);
        }

        //There is no specified key in inventory
        return(false);
    }
 public void AddToInventory(Key.Type keyType)
 {
     m_keys[(int)keyType] = true;
     m_inventoryUI.ShowKeyUI((int)keyType, true);
 }