private void Awake() { authorityArbiter = new AuthorityArbiter(); gameObject.AddComponent <BeforeFixedUpdate>().OnBeforeFixedUpdate += OnBeforeFrame; gameObject.AddComponent <AfterFixedUpdate>().OnAfterFixedUpdate += OnAfterFrame; }
// TODO: Allow authority arbiter to be null, or replace with interface. // If it is not present, all objects should be permitted to write state fields. public void Initialize(AuthorityArbiter authorityArbiter) { statefulObjects = new Dictionary <int, StatefulObject>(); foreach (StatefulObject statefulObject in FindObjectsOfType <StatefulObject>()) { Add(statefulObject, true); } this.authorityArbiter = authorityArbiter; OnInitialize?.Invoke(); }