Skip to content

Display garbage and bin + minor improvements

Karikó Csongor Csanád requested to merge 51-display-garbage-and-bin into master

Closes #51 (closed)

Note:

  • c68bc932 introduces an fps limit of 60
  • In Property<T>, event handlers are now separated into "weak" and "strong" event handlers
    This was necessary for PavementBehaviour to be able to read from Pavement's properties, without interfering with the inspector window.

Weak event handlers:

  • Have to be registered with the dedicated RegisterWeakChangedEventHandler function.
  • The Property instance keeps track of them and removes them from the Changed event if ClearWeakEventHandlers (renamed from ClearEvents) is called.
  • Weak event handlers should be used mainly by the inspector, where it's important to clear them because lifetime issues.
    (I've tried to do this first by storing all registered event handlers in InspectorWindow and deregistering them from there, but this proved to be rather difficult because of the generic types of Property.)

Strong event handlers:

  • Are registered the usual way (with Changed += ...)
  • Have to be deregistered by the class registering them. _ They are used by PavementBehaviour, but could be used by other classes as well in the future.

New features:

  • Garbage is now displayed randomly scattered on pavements
  • New 3D models: 3 types of garbage and a bin

Minor improvements:

  • Teleport detection and movement smoothing, while still not perfect, should be better now. It should work well up to 10x speed.
Edited by Karikó Csongor Csanád

Merge request reports