Implemented room blocking in game.
This commit is contained in:
parent
18908b2ae7
commit
1e95378bb1
24 changed files with 25172 additions and 65 deletions
31
PuzzleGameProject/Assets/Scripts/Rooms/RoomRewards.cs
Normal file
31
PuzzleGameProject/Assets/Scripts/Rooms/RoomRewards.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class RoomRewards : MonoBehaviour
|
||||
{
|
||||
public static event Action<int> DiamondsRewarded;
|
||||
public static event Action ChestRewarded;
|
||||
public static event Action<int> DamageDealt;
|
||||
|
||||
[SerializeField] public int Diamonds = 0;
|
||||
[SerializeField] public int Damage = 0;
|
||||
[SerializeField] public bool Chest = false;
|
||||
|
||||
public void TriggerGetReward()
|
||||
{
|
||||
if (Diamonds > 0)
|
||||
{
|
||||
DiamondsRewarded?.Invoke(Diamonds);
|
||||
}
|
||||
|
||||
if (Chest)
|
||||
{
|
||||
ChestRewarded?.Invoke();
|
||||
}
|
||||
|
||||
if (Damage > 0)
|
||||
{
|
||||
DamageDealt?.Invoke(Damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue