private static void ClearPhase() { BulletManager.ClearPoolControls(false); BulletManager.ClearEmpty(); Events.Event0.Reset(); ETime.Slowdown.RevokeAll(MultiOp.Priority.CLEAR_PHASE); ETime.Timer.ResetPhase(); Events.ClearPhase.Proc(); //Delay this so copy pools can be softculled correctly //TODO: can I remove this? might be permissible to keep copied pools throughout the scene ETime.QueueDelayedEOFInvoke(1, BulletManager.DestroyCopiedPools); //Delay this so that bullets referencing hosting data don't break down before //converting into softcull (note softcull bullets don't run velocity) ETime.QueueDelayedEOFInvoke(1, PublicDataHoisting.ClearValues); }
private void Awake() { if (gm != null) { DestroyImmediate(gameObject); return; } Initialized = true; gm = this; DontDestroyOnLoad(this); //This looks silly, but the static initializer needs to be actively run to ensure that the locale is set correctly. _ = SaveData.s; Log.Unity($"Danmokou {EngineVersion}, {References.gameIdentifier} {References.gameVersion}"); SceneIntermediary.Setup(References.defaultTransition); ParticlePooler.Prepare(); GhostPooler.Prepare(Prefabs.cutinGhost); BEHPooler.Prepare(Prefabs.inode); ItemPooler.Prepare(References.items); ETime.RegisterPersistentSOFInvoke(Replayer.BeginFrame); ETime.RegisterPersistentSOFInvoke(Enemy.FreezeEnemies); ETime.RegisterPersistentEOFInvoke(BehaviorEntity.PrunePoolControls); ETime.RegisterPersistentEOFInvoke(CurvedTileRenderLaser.PrunePoolControls); SceneIntermediary.RegisterSceneUnload(ClearForScene); SceneIntermediary.RegisterSceneLoad(OnSceneLoad); //The reason we do this instead of Awake is that we want all resources to be //loaded before any State Machines are constructed, which may occur in other entities' Awake calls. GetComponent <ResourceManager>().Setup(); GetComponent <BulletManager>().Setup(); GetComponentInChildren <SFXService>().Setup(); GetComponentInChildren <AudioTrackService>().Setup(); if (References.achievements != null) { Achievements = References.achievements.MakeRepo().Construct(); } RunDroppableRIEnumerator(DelayedInitialAchievementsCheck()); }