Space-Smash-Out/Assets/Scripts/ScriptableObjects/MatchRule.cs
Jakob Feldmann 6d89d9d48e fix: introduced assetbundles, instead of reading from folder
Reading Assets from folders was only possible in Editor over  LoadAssetFromPath. Now I'm using asset bundles for ScriptedObjects and Audio Prefabs, when the project is built.
When in Editor the folders are still used for convenience (can make changes to assets without rebuilding asset bundles)
2024-04-18 20:23:17 +02:00

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
}