Class WorldView
- Namespace
- SurvivorsMaker.Presentation
- Assembly
- SurvivorsMaker.Presentation.dll
Reads fixed-tick snapshots into pooled views, then interpolates them each frame.
public sealed class WorldView : MonoBehaviour, IWaveView
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourWorldView
- Implements
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Constructors
WorldView()
public WorldView()
Properties
ActivePlayerId
The view id the player is drawn with in the current wave.
public string ActivePlayerId { get; }
Property Value
ActiveViewCount
public int ActiveViewCount { get; }
Property Value
Catalog
public ViewCatalogAsset Catalog { get; }
Property Value
CreatedViewCount
public int CreatedViewCount { get; }
Property Value
Feedback
public WaveFeedback Feedback { get; }
Property Value
PlayerDefinitionId
The player's view id when the run's character has no catalog entry (or PlayerFromRunCharacter is off). With a bound Session the run's character id is used automatically at each wave start.
public string PlayerDefinitionId { get; set; }
Property Value
PooledViewCount
public int PooledViewCount { get; }
Property Value
RetiringViewCount
public int RetiringViewCount { get; }
Property Value
Session
The session whose run character this view shows. Null = always PlayerDefinitionId.
public IGameSession Session { get; }
Property Value
Settings
public PresentationSettings Settings { get; }
Property Value
Methods
BindSession(IGameSession)
Follows value's run character from the next wave start. RegisterView(IWaveView) calls it.
public void BindSession(IGameSession value)
Parameters
valueIGameSession
Configure(ViewCatalogAsset, SoundCatalogAsset, string, Camera)
public void Configure(ViewCatalogAsset views, SoundCatalogAsset sounds = null, string playerId = null, Camera camera = null)
Parameters
viewsViewCatalogAssetsoundsSoundCatalogAssetplayerIdstringcameraCamera
ProjectileEntry(string)
The look of a weapon's bullets: the weapon entry when it has a projectile sprite or prefab, else an older "projectile.<id>" entry, else the weapon entry itself. Trigger bullets (no weapon) use "projectile.trigger".
public ViewEntry ProjectileEntry(string weaponId)
Parameters
weaponIdstring
Returns
RegisterCustomEvent(string, ICustomEventView)
Shows handler for every event whose CustomId is id
(custom events and built-in events with that detail id). One handler per id; registering again replaces it, null removes it.
public void RegisterCustomEvent(string id, ICustomEventView handler)
Parameters
idstringhandlerICustomEventView
RegisterCustomEvent(string, Action<SimEvent, SimWorld, WorldView>)
public void RegisterCustomEvent(string id, Action<SimEvent, SimWorld, WorldView> handler)
Parameters
Render(SimWorld, float)
Every frame. alpha 0–1 is the time between the last two ticks, for interpolation.
public void Render(SimWorld world, float alpha)
Parameters
Tick(SimWorld)
After one simulation step. world.Events holds this tick's events.
public void Tick(SimWorld world)
Parameters
worldSimWorld
TryGetView(WorldViewKind, int, out Transform)
Player uses id 0; weapons use slot ids; all other kinds use simulation ids.
public bool TryGetView(WorldViewKind kind, int id, out Transform view)
Parameters
kindWorldViewKindidintviewTransform
Returns
UnregisterCustomEvent(string)
public bool UnregisterCustomEvent(string id)
Parameters
idstring
Returns
WaveEnded(SimWorld)
public void WaveEnded(SimWorld world)
Parameters
worldSimWorld
WaveStarted(SimWorld)
public void WaveStarted(SimWorld world)
Parameters
worldSimWorld
Events
CustomEventRaised
Raised for every Custom event, after any handler registered for its id.
public event Action<SimEvent, SimWorld> CustomEventRaised