Fixed Monster rooms unable to be '='
This commit is contained in:
parent
2f1b2d49b3
commit
401e93075d
16 changed files with 31954 additions and 11 deletions
13656
PuzzleGameProject/Assets/Another Hard Start.unity
Normal file
13656
PuzzleGameProject/Assets/Another Hard Start.unity
Normal file
File diff suppressed because it is too large
Load diff
7
PuzzleGameProject/Assets/Another Hard Start.unity.meta
Normal file
7
PuzzleGameProject/Assets/Another Hard Start.unity.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0571a92c0aaa26d45afc285d4ff7ae0d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
14538
PuzzleGameProject/Assets/Scenes/TestDungeons/Hard Start.unity
Normal file
14538
PuzzleGameProject/Assets/Scenes/TestDungeons/Hard Start.unity
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d580ae042da08514f9c96db2800f39e9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -7,15 +7,8 @@ public class EmptyRoom : Room
|
|||
|
||||
protected override void InitializeRoom() {
|
||||
base.InitializeRoom();
|
||||
TextMeshProUGUI numberText = numberTextObject.GetComponent<TextMeshProUGUI>();
|
||||
if (_locks[0] is NumberLock )
|
||||
{
|
||||
numberText.SetText(((NumberLock)_locks[0]).GetNumber().ToString());
|
||||
}
|
||||
else if (_locks[0] is MatchingDiceLock)
|
||||
{
|
||||
numberText.SetText("=");
|
||||
}
|
||||
TextMeshProUGUI text = numberTextObject.GetComponent<TextMeshProUGUI>();
|
||||
SetLockGUI(text, _locks[0]);
|
||||
}
|
||||
|
||||
public override bool TryUnlock(DicePair pair)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ public class MonsterRoom : Room
|
|||
base.InitializeRoom();
|
||||
|
||||
// Create the lock numbers on the room.
|
||||
numberTextObject.GetComponent<TextMeshProUGUI>().text = ((NumberLock)_locks[0]).GetNumber().ToString();
|
||||
TextMeshProUGUI text = numberTextObject.GetComponent<TextMeshProUGUI>();
|
||||
SetLockGUI(text, _locks[0]);
|
||||
GameObject lockToDuplicate = numberTextObject;
|
||||
for (int i = 1; i < _locks.Length; i++)
|
||||
{
|
||||
|
|
@ -34,7 +35,7 @@ public class MonsterRoom : Room
|
|||
}
|
||||
|
||||
public override bool TryUnlock(DicePair pair) {
|
||||
foreach (NumberLock numberLock in _locks)
|
||||
foreach (Lock numberLock in _locks)
|
||||
{
|
||||
if (numberLock.CheckIfKeyFits(pair))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -118,6 +118,18 @@ public abstract class Room : MonoBehaviour
|
|||
RoomExploredByDice?.Invoke(this, this);
|
||||
}
|
||||
|
||||
protected void SetLockGUI(TextMeshProUGUI text, Lock _lock)
|
||||
{
|
||||
if (_lock is NumberLock )
|
||||
{
|
||||
text.SetText(((NumberLock)_locks[0]).GetNumber().ToString());
|
||||
}
|
||||
else if (_lock is MatchingDiceLock)
|
||||
{
|
||||
text.SetText("=");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRoomExploredByTorch()
|
||||
{
|
||||
RoomExploredByTorch?.Invoke(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue