Fixed Monster rooms unable to be '='
This commit is contained in:
parent
2f1b2d49b3
commit
401e93075d
16 changed files with 31954 additions and 11 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1915
Dungeons/dungeon06.json
Normal file
1915
Dungeons/dungeon06.json
Normal file
File diff suppressed because it is too large
Load diff
1814
Dungeons/dungeon07.json
Normal file
1814
Dungeons/dungeon07.json
Normal file
File diff suppressed because it is too large
Load diff
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() {
|
protected override void InitializeRoom() {
|
||||||
base.InitializeRoom();
|
base.InitializeRoom();
|
||||||
TextMeshProUGUI numberText = numberTextObject.GetComponent<TextMeshProUGUI>();
|
TextMeshProUGUI text = numberTextObject.GetComponent<TextMeshProUGUI>();
|
||||||
if (_locks[0] is NumberLock )
|
SetLockGUI(text, _locks[0]);
|
||||||
{
|
|
||||||
numberText.SetText(((NumberLock)_locks[0]).GetNumber().ToString());
|
|
||||||
}
|
|
||||||
else if (_locks[0] is MatchingDiceLock)
|
|
||||||
{
|
|
||||||
numberText.SetText("=");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool TryUnlock(DicePair pair)
|
public override bool TryUnlock(DicePair pair)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ public class MonsterRoom : Room
|
||||||
base.InitializeRoom();
|
base.InitializeRoom();
|
||||||
|
|
||||||
// Create the lock numbers on the room.
|
// 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;
|
GameObject lockToDuplicate = numberTextObject;
|
||||||
for (int i = 1; i < _locks.Length; i++)
|
for (int i = 1; i < _locks.Length; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -34,7 +35,7 @@ public class MonsterRoom : Room
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool TryUnlock(DicePair pair) {
|
public override bool TryUnlock(DicePair pair) {
|
||||||
foreach (NumberLock numberLock in _locks)
|
foreach (Lock numberLock in _locks)
|
||||||
{
|
{
|
||||||
if (numberLock.CheckIfKeyFits(pair))
|
if (numberLock.CheckIfKeyFits(pair))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,18 @@ public abstract class Room : MonoBehaviour
|
||||||
RoomExploredByDice?.Invoke(this, this);
|
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()
|
private void OnRoomExploredByTorch()
|
||||||
{
|
{
|
||||||
RoomExploredByTorch?.Invoke(this);
|
RoomExploredByTorch?.Invoke(this);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue