Class UnityStageService
Unity MonoBehaviour implementation of IStageService.
Supports a hybrid authoring model: Stage Prefab (spatial) + ScriptableObjects (tuning).
After instantiation, extracts IStageRoot, IRailPathAuthoring,
and ISpawnPointResolver from the prefab hierarchy.
Inheritance
UnityStageService
Assembly: Serenity.UnityStage.Infrastructure.dll
Syntax
public class UnityStageService : MonoBehaviour, IStageService, IService, IFoundationSettings, IUnityStageRuntime
Constructors
UnityStageService()
Declaration
public UnityStageService()
Fields
LOG_CATEGORY
Declaration
protected const string LOG_CATEGORY = "StageService"
Field Value
_gameWrapper
Declaration
protected GameObject _gameWrapper
Field Value
| Type |
Description |
| GameObject |
|
_guid
Declaration
Field Value
_id
Declaration
Field Value
_logService
Declaration
protected ILogService _logService
Field Value
_spawnPointResolver
Declaration
protected ISpawnPointResolver _spawnPointResolver
Field Value
_stageInstance
Declaration
protected GameObject _stageInstance
Field Value
| Type |
Description |
| GameObject |
|
_stageRoot
Declaration
protected StageRoot _stageRoot
Field Value
_state
Declaration
protected StageState _state
Field Value
Properties
Guid
Declaration
public string Guid { get; set; }
Property Value
Id
Declaration
public string Id { get; set; }
Property Value
LogService
Declaration
public ILogService LogService { get; set; }
Property Value
SpawnPointResolver
The spawn point resolver extracted from the instantiated prefab, or null.
Declaration
public ISpawnPointResolver SpawnPointResolver { get; }
Property Value
StageRoot
The stage root extracted from the instantiated prefab, or null.
Declaration
public IStageRoot StageRoot { get; }
Property Value
Methods
CompleteStage()
Declaration
public virtual void CompleteStage()
FailStage()
Declaration
public virtual void FailStage()
GetSnapshot()
Declaration
public virtual StageSnapshot GetSnapshot()
Returns
InitializeService(IFoundationViewElement, ILogService)
Initializes the service with required dependencies.
Declaration
public virtual void InitializeService(IFoundationViewElement GameWrapper, ILogService logService)
Parameters
InstantiateStagePrefab(GameObject)
Instantiates the given stage prefab and extracts authoring components:
StageRoot, RailPathAuthoring, SpawnPointRegistry.
Declaration
public virtual GameObject InstantiateStagePrefab(GameObject stagePrefab)
Parameters
| Type |
Name |
Description |
| GameObject |
stagePrefab |
The stage prefab to instantiate.
|
Returns
| Type |
Description |
| GameObject |
The instantiated stage GameObject, or null if the prefab is null.
|
StartStage(StageId)
Starts the stage with the given identity.
Declaration
public virtual void StartStage(StageId stageId)
Parameters
| Type |
Name |
Description |
| StageId |
stageId |
The stage identity.
|
Implements