/// <summary> /// Initializes the game processor instance. /// </summary> private void InitGameProcessor() { if (CurrentParameter.IsReplay) { gameProcessor = GameGui.CreateChild <ReplayGameProcessor>(); } else { gameProcessor = GameGui.CreateChild <LocalGameProcessor>(); } Dependencies.Cache(gameProcessor); }
private void Init() { Dependencies.CacheAs <IRecycler <ReplayableInput> >(replayInputRecycler); Dependencies.CacheAs <IRecycler <ReplayFrame> >(replayFrameRecycler); base.OnHardInit += () => { InitGameProcessor(); }; base.OnHardDispose += () => { Dependencies.Remove(gameProcessor); gameProcessor.Destroy(); gameProcessor = null; }; }