Merge pull request #1369 from Balint-H:feature/unity-events
PiperOrigin-RevId: 602671446 Change-Id: I7a21230152a0139e37f44578ca19ec5eaa02296e
This commit is contained in:
@@ -78,11 +78,11 @@ public class MjScene : MonoBehaviour {
|
|||||||
|
|
||||||
private List<MjComponent> _orderedComponents;
|
private List<MjComponent> _orderedComponents;
|
||||||
|
|
||||||
public EventHandler<MjStepArgs> postInitEvent;
|
public event EventHandler<MjStepArgs> postInitEvent;
|
||||||
public EventHandler preUpdateEvent;
|
public event EventHandler<MjStepArgs> preUpdateEvent;
|
||||||
public EventHandler<MjStepArgs> ctrlCallback;
|
public event EventHandler<MjStepArgs> ctrlCallback;
|
||||||
public EventHandler postUpdateEvent;
|
public event EventHandler<MjStepArgs> postUpdateEvent;
|
||||||
public EventHandler<MjStepArgs> preDestroyEvent;
|
public event EventHandler<MjStepArgs> preDestroyEvent;
|
||||||
|
|
||||||
protected unsafe void Start() {
|
protected unsafe void Start() {
|
||||||
SceneRecreationAtLateUpdateRequested = false;
|
SceneRecreationAtLateUpdateRequested = false;
|
||||||
@@ -94,9 +94,9 @@ public class MjScene : MonoBehaviour {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected unsafe void FixedUpdate() {
|
protected unsafe void FixedUpdate() {
|
||||||
preUpdateEvent?.Invoke(this, EventArgs.Empty);
|
preUpdateEvent?.Invoke(this, new MjStepArgs(Model, Data));
|
||||||
StepScene();
|
StepScene();
|
||||||
postUpdateEvent?.Invoke(this, EventArgs.Empty);
|
postUpdateEvent?.Invoke(this, new MjStepArgs(Model, Data));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SceneRecreationAtLateUpdateRequested = false;
|
public bool SceneRecreationAtLateUpdateRequested = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user