This PR add a flag to allow Actors to not call the logic in OnDestroy if wanted. This is necessary for holograms. Holograms are destroyed when placing them, and the OnDestroy callback of unity executes. Issue is, sometimes the logic in OnDestroy
should not be called as the components are inactive and some references might be not set up properly.
you can test it by adding this in the item script, and see that no log appears in console when destroying holograms
Summary
This PR add a flag to allow Actors to not call the logic in OnDestroy if wanted. This is necessary for holograms. Holograms are destroyed when placing them, and the OnDestroy callback of unity executes. Issue is, sometimes the logic in OnDestroy should not be called as the components are inactive and some references might be not set up properly.
you can test it by adding this in the item script, and see that no log appears in console when destroying holograms
protected override void OnDestroyed() { base.OnDestroyed(); Debug.Log("destroy item logic"); }
PR checklist
Pictures/Videos)
Testing
Networking checklist
Changes
Related issues/PRs