63 lines
1.9 KiB
C#
63 lines
1.9 KiB
C#
using System;
|
|
using Intrepid.GameManagers;
|
|
using Intrepid.Gameplay.Entities.Player.PDA.Events;
|
|
using Intrepid.Gameplay.Entities.Player.PDA.Inputs;
|
|
using Intrepid.SimpleEvents;
|
|
using Intrepid.Structures;
|
|
using Intrepid.Utilities;
|
|
using UnityEngine;
|
|
|
|
namespace Intrepid.Gameplay.Entities.Player.PDA.UI
|
|
{
|
|
public abstract class PDAApplicationUI : Identification, IPDAApplicationUpdater, IPDASystemBootEvents, IPDASystemShutdownEvents
|
|
{
|
|
[SerializeField, GroupConfigurations] private PDAContentTag contentTag;
|
|
|
|
protected PDARuntime Runtime { get; private set; }
|
|
public PDAContentTag ContentTag => contentTag;
|
|
|
|
public abstract bool IsLoading { get; }
|
|
public abstract void UpdateTheme();
|
|
public abstract void UpdateApplication(PDAInputs inputs);
|
|
public abstract void LateUpdateApplication(PDAInputs inputs);
|
|
protected abstract void Subscribing();
|
|
protected abstract void WhenStarting(ParameterStore parameters);
|
|
protected abstract void WhenFinishing();
|
|
|
|
public void WhenEntering(PDARuntime runtime)
|
|
{
|
|
Runtime = runtime;
|
|
Subscribing();
|
|
UpdateTheme();
|
|
WhenStarting(Runtime.ParameterStore);
|
|
}
|
|
|
|
public void WhenExiting()
|
|
{
|
|
WhenFinishing();
|
|
Proxy.Instance.EventBus.UnSubscribe(Id);
|
|
}
|
|
|
|
public virtual void WhenPreparingSystemBoot()
|
|
{
|
|
}
|
|
|
|
public virtual void WhenRunningSystemBoot()
|
|
{
|
|
}
|
|
|
|
public virtual void WhenPreparingSystemShutdown()
|
|
{
|
|
Proxy.Instance.EventBus.Raise(new PDAExitCurrentApplicationEvent());
|
|
}
|
|
|
|
public virtual void WhenRunningSystemShutdown()
|
|
{
|
|
}
|
|
|
|
protected void Subscribe<TEvent>(Action<TEvent> action) where TEvent : IEventBase
|
|
{
|
|
Proxy.Instance.EventBus.Subscribe(Id, action);
|
|
}
|
|
}
|
|
} |