revival/game/Assets/Scripts/Flow/BootstrapConfig.cs

54 lines
1.4 KiB
C#
Raw Normal View History

2021-02-12 10:32:10 +01:00
using System.Collections;
using System.Collections.Generic;
using NaughtyAttributes;
using NaughtyAttributes.Test;
using UnityEngine;
2021-02-12 15:04:12 +01:00
using UnityEngine.Serialization;
2021-02-12 10:32:10 +01:00
[CreateAssetMenu(fileName = "BootstrapConfig.asset", menuName = "KernelPanic/Boot/Config")]
public class BootstrapConfig : ScriptableObject
{
[Header("Scenes")]
[SerializeField] [Scene]
private string BootflowScene;
[SerializeField] [Scene]
private string MainMenuScene;
[SerializeField] [Scene]
private string CreditsScene;
[SerializeField] [Scene]
private string GameplayScene;
2021-02-12 15:04:12 +01:00
public LevelDescriptor StartLevel => _startLevel;
2021-02-12 10:32:10 +01:00
[SerializeField]
2021-02-12 15:04:12 +01:00
private LevelDescriptor _startLevel;
2021-02-12 10:32:10 +01:00
2021-02-12 15:04:12 +01:00
public float TransitionDuration => _transitionDuration;
2021-02-12 10:32:10 +01:00
[Header( "Transition" )]
2021-02-12 15:04:12 +01:00
[SerializeField] [FormerlySerializedAs("TransitionDuration")]
private float _transitionDuration;
2021-02-12 10:32:10 +01:00
public string GetScene( SceneType sceneType )
{
switch ( sceneType )
{
case SceneType.BootSequence:
return BootflowScene;
case SceneType.MainMenu:
return MainMenuScene;
case SceneType.Gameplay:
return GameplayScene;
case SceneType.Credits:
return CreditsScene;
default:
return null;
}
}
}