![]() |
TilePlus Version 5
Unity3D Tilemap Extension
|
Simple and simplistic base class for Runtime Services. "Scriptable Runtime Service" or SRS. More...


Public Member Functions | |
| virtual string | Status () |
| The TilePlus SysInfo window will show all SRS 'Status' strings when playing in-editor (if the 'show' checkbox is checked). This is totally optional. | |
| virtual bool | CanPollForDetails () |
| Used by SRS inspector. If the contents of an SRS change frequently then this should be overridden to return true. | |
| virtual string | Details (int length=-1) |
| The SRS inspector utility will show whatever this returns. | |
| override string | ToString () |
| Customize ToString in overrides. | |
| virtual void | OnEnable () |
| OnEnable. | |
| virtual void | OnDisable () |
| Unity event method. | |
| Public Member Functions inherited from TilePlus.IScriptableService | |
| void | Update (float deltaTime) |
| Update implementation: Must override with explicit implementation. | |
| void | MessageTarget (ObjectPacket packet) |
| If Accepts messages is true, reimplement this to get messaged. | |
Static Protected Member Functions | |
| static void | Create () |
| Create and initialize method. | |
Properties | |
| string | ServiceName [get] |
| A name for this service: used for profiling. Ordinarily just returns the 'name' property of the Service S.O. instance. | |
| Properties inherited from TilePlus.IScriptableService | |
| bool | PeristThruReload [get] |
| If true, this will not be deleted when the Unity scene changes. | |
| bool | WantsUpdate [get] |
| Does this SRS want an update tick? MUST override if you're providing an Update method. MUST override with explicit implementation. | |
| bool | ReadyForUpdate [get] |
| Is this SRS ready for an update? MUST Override if your SRS doesn't always need an update. MUST override with explicit implementation. | |
| string[] | AcceptableMessages [get] |
| If true, can accept ObjectPacket messages from the Service Manager with command-strings matching those returned here. | |
Simple and simplistic base class for Runtime Services. "Scriptable Runtime Service" or SRS.
| T | Type spec |
Access a SRS with TpLib's Service manager methods such as RequestServiceOfType<T>
TO USE THE SERVICE MANAGER: all concrete implementations MUST implement TpLib.PreRegisterSRS with the [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] attribute. See TpMessaging for an example. If that's not done, then the SRS won't be available by the service manager. ---------------— WARNING -— Cannot use in EDIT mode!!! ------------------—
There's no need to cache references, use the service manager to obtain the instance. The ServiceManager call is public static T? GetServiceOfType<T>(Action<UnityEngine.Object?*gt;? initializer=null, bool log=true) It's a very fast dictionary lookup, so unless it's a performance bottleneck (hard to imagine) there's no need to cache the handle returned from GetServiceOfType. The initializer is optional but may be required by specific services; e.g., TpTilePositionDb. ------------— Persistent through app lifetime --------------— Once instantiated, SRS should not be destroyed unless one knows that they don't have any
| T | : | ScriptableObject | |
| T | : | IScriptableService |
|
virtual |
Used by SRS inspector. If the contents of an SRS change frequently then this should be overridden to return true.
accessed via reflection (editor only) don't change this to a prop or change the name
Reimplemented in TilePlus.TpMessaging, TilePlus.TpSpawner, and TilePlus.TpTweener.
|
staticprotected |
Create and initialize method.
DO NOT USE ScriptableObject.CreateInstance. IT WON'T WORK PROPERLY!!! This is a protected method intentionally: use the TpLib GetServiceOfType method for a service handle (reference).
|
virtual |
The SRS inspector utility will show whatever this returns.
accessed via reflection (editor only) don't change this to a prop or change the name
Reimplemented in TilePlus.TpMessaging, TilePlus.TpSpawner, and TilePlus.TpTweener.
|
virtual |
Unity event method.
Reimplemented in TilePlus.TpSpawner, TilePlus.TpTilePositionDb, and TilePlus.TpTweener.
|
virtual |
OnEnable.
Reimplemented in TilePlus.TpMessaging, TilePlus.TpSpawner, TilePlus.TpTilePositionDb, and TilePlus.TpTweener.
|
virtual |
The TilePlus SysInfo window will show all SRS 'Status' strings when playing in-editor (if the 'show' checkbox is checked). This is totally optional.
Reimplemented in TilePlus.TpMessaging, TilePlus.TpSpawner, TilePlus.TpTilePositionDb, and TilePlus.TpTweener.
| override string TilePlus.ScriptableRuntimeService< T >.ToString | ( | ) |
Customize ToString in overrides.
|
get |
A name for this service: used for profiling. Ordinarily just returns the 'name' property of the Service S.O. instance.
Implements TilePlus.IScriptableService.