protected override void Setup() { config = LoadConfig <MeteoConfig>(); CreateInputKeywordAsObservable("meteo") .Subscribe(_ => { IsActive = !IsActive; DrawText("Meteo:" + IsActive, 3.0f); }); OnAllOnCommandObservable.Subscribe(_ => IsActive = true); //落下地点マーカ描画 OnDrawingTickAsObservable .Where(_ => meteoLightPositionList.Count > 0) .Subscribe(_ => { var insensity = 10; foreach (var point in meteoLightPositionList.ToArray()) { NativeFunctions.CreateLight(point, 255, 0, 0, 1.0f, insensity); } }); CreateTickAsObservable(TimeSpan.FromMilliseconds(DurationMillSeconds)) .Where(_ => IsActive && Random.Next(0, 100) <= Probability) .Subscribe(_ => ShootMeteo()); }
protected override void Setup() { var screenResolution = NativeFunctions.GetScreenResolution(); _screenHeight = (int)screenResolution.Y; _screenWidth = (int)screenResolution.X; _mContainer = new UIContainer(new Point(0, 0), new Size(_screenWidth, _screenHeight)); OnDrawingTickAsObservable .Where(_ => this.GetPlayerVehicle().IsSafeExist() && PlayerPed.IsAlive) .Subscribe(_ => { _mContainer.Items.Clear(); GetVehicleHealth(); _mContainer.Draw(); }); }
protected override void Setup() { config = LoadConfig <ChaosAirPlaneConfig>(); CreateInputKeywordAsObservable("cair") .Subscribe(_ => { IsActive = !IsActive; DrawText("ChaosPlane:" + IsActive, 3.0f); }); OnAllOnCommandObservable .Subscribe(_ => { IsActive = true; }); IsActiveAsObservable.Where(x => x) .Subscribe(_ => StartCoroutine(StartChaosPlanes())); //ターゲット描画 OnDrawingTickAsObservable .Where(_ => IsActive && targetArea.Count > 0) .Subscribe(_ => { var insensity = 5; var array = targetArea.Values .Where(x => x != null) .Select(x => x.Value); foreach (var point in array) { NativeFunctions.CreateLight(point, 255, 30, 30, 10.0f, insensity); } }); }