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
Object
Component
Behaviour
MonoBehaviour
WorldView
Implements
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.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.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.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.name
Object.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

string

ActiveViewCount

public int ActiveViewCount { get; }

Property Value

int

Catalog

public ViewCatalogAsset Catalog { get; }

Property Value

ViewCatalogAsset

CreatedViewCount

public int CreatedViewCount { get; }

Property Value

int

Feedback

public WaveFeedback Feedback { get; }

Property Value

WaveFeedback

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

string

PooledViewCount

public int PooledViewCount { get; }

Property Value

int

RetiringViewCount

public int RetiringViewCount { get; }

Property Value

int

Session

The session whose run character this view shows. Null = always PlayerDefinitionId.

public IGameSession Session { get; }

Property Value

IGameSession

Settings

public PresentationSettings Settings { get; }

Property Value

PresentationSettings

Methods

BindSession(IGameSession)

Follows value's run character from the next wave start. RegisterView(IWaveView) calls it.

public void BindSession(IGameSession value)

Parameters

value IGameSession

Configure(ViewCatalogAsset, SoundCatalogAsset, string, Camera)

public void Configure(ViewCatalogAsset views, SoundCatalogAsset sounds = null, string playerId = null, Camera camera = null)

Parameters

views ViewCatalogAsset
sounds SoundCatalogAsset
playerId string
camera Camera

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

weaponId string

Returns

ViewEntry

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

id string
handler ICustomEventView

RegisterCustomEvent(string, Action<SimEvent, SimWorld, WorldView>)

public void RegisterCustomEvent(string id, Action<SimEvent, SimWorld, WorldView> handler)

Parameters

id string
handler Action<SimEvent, SimWorld, WorldView>

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

world SimWorld
alpha float

Tick(SimWorld)

After one simulation step. world.Events holds this tick's events.

public void Tick(SimWorld world)

Parameters

world SimWorld

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

kind WorldViewKind
id int
view Transform

Returns

bool

UnregisterCustomEvent(string)

public bool UnregisterCustomEvent(string id)

Parameters

id string

Returns

bool

WaveEnded(SimWorld)

public void WaveEnded(SimWorld world)

Parameters

world SimWorld

WaveStarted(SimWorld)

public void WaveStarted(SimWorld world)

Parameters

world SimWorld

Events

CustomEventRaised

Raised for every Custom event, after any handler registered for its id.

public event Action<SimEvent, SimWorld> CustomEventRaised

Event Type

Action<SimEvent, SimWorld>