Refactored locks for rooms to be more versatile by giving them their own type.
This commit is contained in:
parent
7bec7c539d
commit
d79d6216f0
13 changed files with 85 additions and 53 deletions
21
PuzzleGameProject/Assets/Scripts/Rooms/Locks/NumberLock.cs
Normal file
21
PuzzleGameProject/Assets/Scripts/Rooms/Locks/NumberLock.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class NumberLock : Lock
|
||||
{
|
||||
[SerializeField] private int number;
|
||||
|
||||
public override bool CheckIfKeyFits(DicePair dicePair)
|
||||
{
|
||||
if (dicePair.Sum() == number)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int GetNumber()
|
||||
{
|
||||
return number;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue