public AutoTerrainNavigatorSystem(Contexts contexts) { if (App.Shared.SharedConfig.InSamplingMode || App.Shared.SharedConfig.InLegacySampleingMode) // 仅在开启SampleFPS选项时挂载脚本 { GameObject gameController = GameObject.Find("GameController"); TerrainSampler sampler = gameController.AddComponent <TerrainSampler>(); sampler.PlayerContext = contexts.player; sampler.LevelManager = contexts.session.commonSession.LevelManager; } }
public void Init(Contexts contexts, TerrainSampleConfig config, TerrainSampler mono) { playerContext = contexts.player; levelManager = contexts.session.commonSession.LevelManager; this.mono = mono; url = config.Url; waitForSample = config.WaitForSample; sampleCount = config.SampleCount; enableFrameLimit = config.EnableFrameLimit; frameLimit = config.FrameLimit; enablePosLimit = config.EnablePosLimit; posLimitX = config.PosLimitX; posLimitZ = config.PosLimitZ; posLimitDir = config.PosLimitDir; SetQuality(config.Quality, config.UseHallQuality, config.HallQuality); }
public AutoTerrainNavigatorSystem(Contexts contexts) { if (!SharedConfig.InSamplingMode && !SharedConfig.InLegacySampleingMode) { return; } GameObject controller = GameObject.Find("GameController"); if (controller == null) { Debug.LogError("AutoTerrainNavigatorSystem error, can't get GameController"); return; } TerrainSampler sampler = controller.GetComponent <TerrainSampler>(); if (sampler == null) { sampler = controller.AddComponent <TerrainSampler>(); } sampler.StartSample(contexts); }