mirror of
https://github.com/DerTyp7/example-top-down-unity.git
synced 2025-10-30 12:57:08 +01:00
Added remove method
Added add slot method Added comments
This commit is contained in:
@@ -15,21 +15,10 @@ public class Slot
|
||||
count = 0;
|
||||
|
||||
}
|
||||
public bool removeItem()
|
||||
public bool removeItem(int count = 1)
|
||||
{
|
||||
if (count > 0)
|
||||
{
|
||||
count--;
|
||||
if (count == 0)
|
||||
{
|
||||
item = null;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.count -= count;
|
||||
return true;
|
||||
}
|
||||
public bool addItem(int count = 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user