ExtendRealityLtd / Malimbe

[Obsolete - No longer maintained] A collection of tools to simplify writing public API components for the Unity software.
MIT License
51 stars 11 forks source link

Clear via type's Clear method #14

Closed bddckr closed 5 years ago

bddckr commented 5 years ago

The current implementation of the ClearPropertyMethod weaver only sets a reference type property to null.

The task is to instead do the following (in order):

  1. Call the getter to retrieve the current value.
  2. Compare the value against null/the type's default value.
  3. If it's null/default return early.
  4. If it's not null/default check if the type has a public void Clear() method.
  5. Call that Clear method on the value if found.
  6. If not found continue doing the existing property = default; instead.

Also update the documentation found in the Readme.

bddckr commented 5 years ago

Closing in favor of #25.