public static void Request(BEHStyleMetadata style, BehaviorEntity?parent, Movement vel, ParametricInfo pi, float cold, float hot, SOPlayerHitbox collisionTarget, ref RealizedLaserOptions options) { Laser created = (Laser)BEHPooler.RequestUninitialized(style.RecolorOrThrow.prefab, out bool isNew); created.Initialize(isNew, parent, vel, pi, collisionTarget, cold, hot, style, ref options); }
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()); }
private void Initialize(bool isNew, BehaviorEntity?parent, Movement movement, ParametricInfo pi, SOPlayerHitbox _target, float cold, float hot, BEHStyleMetadata style, ref RealizedLaserOptions options) { pi.ctx.laserController = ctr; ctr.SetYScale(options.yScale * defaultWidthMultiplier); //Needs to be done before Colorize sets first frame base.Initialize(style, options.AsBEH, parent, movement, pi, _target, out _); // Call after Awake/Reset if (options.endpoint != null) { var beh = BEHPooler.INode(Movement.None, new ParametricInfo(Vector2.zero, bpi.index), Vector2.right, options.endpoint); endpt = new PointContainer(beh); ctr.SetupEndpoint(endpt); } else { ctr.SetupEndpoint(new PointContainer(null)); } ctr.Initialize(this, config, style.RecolorOrThrow.material, isNew, bpi, ref options); SFXService.Request(options.firesfx); SetColdHot(cold, hot, options.hotsfx, options.repeat); ctr.Activate(); //This invokes UpdateMesh }
public static void Request(BEHStyleMetadata style, Movement movement, ParametricInfo pi, float maxRemember, BPY remember, SOPlayerHitbox collisionTarget, ref RealizedBehOptions opts) { Pather created = (Pather)BEHPooler.RequestUninitialized(style.RecolorOrThrow.prefab, out bool isNew); created.Initialize(isNew, movement, pi, collisionTarget, maxRemember, remember, style, ref opts); }