31 lines
970 B
C#
31 lines
970 B
C#
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Class with which the rules of a game mode can be set and stored.
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "MatchRule", menuName = "ScriptableObjects/MatchRule")]
|
|
public class MatchRule : ScriptableObject
|
|
{
|
|
[Tooltip("The kind of variable which decides over what wins a round.")]
|
|
public WinCondition winCondition;
|
|
[Tooltip("How many rounds have to be won to win the match.")]
|
|
public int rounds;
|
|
[Tooltip("How many lives a player has.")]
|
|
public int lives;
|
|
[Tooltip("The score a player has to reach to win the round.")]
|
|
public int score;
|
|
[Tooltip("How long the game lasts. Can be a win condition, but also influences things like sudden death. (-1 for no time limit)")]
|
|
public int time;
|
|
[Tooltip("Does a match/round enter sudden death once the time is up?")]
|
|
public bool suddenDeath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The kinds of conditions which can win a match/round.
|
|
/// </summary>
|
|
public enum WinCondition
|
|
{
|
|
Lives,
|
|
Score,
|
|
Time
|
|
} |