forked from Shardstone/trail-into-darkness
added documentation, fixed some bugs
This commit is contained in:
@@ -3,6 +3,10 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Jovian.PopupSystem {
|
||||
/// <summary>
|
||||
/// ScriptableObject holding all popup system configuration. Create via
|
||||
/// Assets > Create > Jovian > Popup System > Popup Settings.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "PopupSettings", menuName = "Jovian/Popup System/Popup Settings")]
|
||||
public class PopupSettings : ScriptableObject {
|
||||
[Header("General")]
|
||||
@@ -26,6 +30,9 @@ namespace Jovian.PopupSystem {
|
||||
[Header("Per-Category Overrides")]
|
||||
public List<CategoryDelay> categoryDelayOverrides = new();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the configured priority for a category, or 0 if not configured.
|
||||
/// </summary>
|
||||
public int GetPriority(PopupCategory category) {
|
||||
foreach(var cp in categoryPriorities) {
|
||||
if(cp.category == category) {
|
||||
@@ -35,6 +42,9 @@ namespace Jovian.PopupSystem {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the configured delay override for a category, or the default popupDelay.
|
||||
/// </summary>
|
||||
public float GetDelay(PopupCategory category) {
|
||||
foreach(var cd in categoryDelayOverrides) {
|
||||
if(cd.category == category) {
|
||||
|
||||
Reference in New Issue
Block a user