void OnEvent_OnAllPlayerFinishedLoad(object param) { Debug.Log($"OnEvent_OnAllPlayerFinishedLoad"); if (Running) { return; } _world.StartSimulate(); Running = true; SetPurchaseTimestamp(); EventHelper.Trigger(EEvent.OnSimulationStart, null); }
public void StartSimulate() { if (Running) { return; } _world.StartSimulate(); Running = true; SetPurchaseTimestamp(); Debug.Log($"Game Start"); EventHelper.Trigger(EEvent.SimulationStart, null); }
public void OnGameCreate(int targetFps, byte localActorId, byte actorCount, bool isNeedRender = true) { FrameBuffer.__debugMainActorID = localActorId; var allActors = new byte[actorCount]; for (byte i = 0; i < actorCount; i++) { allActors[i] = i; } Debug.Log($"GameCreate " + LocalActorId); //Init game status //_localActorId = localActorId; _allActors = allActors; _constStateService.LocalActorId = LocalActorId; _world.StartSimulate(_serviceContainer, _mgrContainer); EventHelper.Trigger(EEvent.LevelLoadProgress, 1f); }
public void OnGameCreate(int targetFps, byte localActorId, byte actorCount, bool isNeedRender = true) { FrameBuffer.DebugMainActorID = localActorId; var allActors = new byte[actorCount]; for (byte i = 0; i < actorCount; i++) { allActors[i] = i; } //初始化全局配置 _localActorId = localActorId; _allActors = allActors; _localTick = 0; _actorCount = allActors.Length; _tickDt = 1000f / targetFps; _world.StartSimulate(_serviceContainer, _mgrContainer); EventHelper.Trigger(EEvent.LevelLoadProgress, 1f); }