private void OnWeatherChange(SkyMasterManager.Volume_Weather_types currentWeather, SkyMasterManager.Volume_Weather_types newWeather) { LogUtils.Debug("Weather has changed to: " + newWeather); if (IsServer()) { Channel.Send(nameof(Network_SetWeather), ECall.Others, (int)newWeather); } }
protected override void Awake() { base.Awake(); if (!Connection.IsSinglePlayer && !IsServer()) { Channel.Send(nameof(Network_RequestWeather), ECall.Server); } _cachedWeather = Weather; }
protected override void Update() { base.Update(); if (Debug.isDebugBuild) { if (Input.GetKeyDown(KeyCode.F1) && IsServer()) { Weather = GetRandomWeather(); } if (Input.GetKey(KeyCode.F2) && IsServer()) { SendWeatherTimeUpdate(); World.Instance.WeatherSettings.SkyMaster.SkyManager.Current_Time += 0.05f; } } if (Weather != _cachedWeather) { OnWeatherChange(_cachedWeather, Weather); _cachedWeather = Weather; } }