public override void RegularUpdate() { recordCtr += ETime.FRAME_TIME; if (recordCtr > recordPositionEvery) { recordCtr -= recordPositionEvery; GhostPooler.Request(beh.GlobalPosition(), DMath.M.RotateVectorDeg(beh.LastDelta * (AIVelocitySpeedRatio / ETime.FRAME_TIME), AIVelocityRotationDeg), ghost); } }
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()); }