private void LogEvent(FastForwardEvent e) { if (e.LoggingLevel <= LoggingLevel) { Debug.Log(e.Description); } }
public void fastForward(bool flag) { if (this.isPlaying && forwardFlag && !flag) { lock (EmotionModel.svmFeature) { EmotionModel.svmFeature[(int)VideoFeature.FASTFORWARD].Value = 0; } forwardFlag = false; EventFactory.finishPeriodEvent(fastForwardEvent, (int)mPlayer.GetPlayTime()); storeModule.savePeriodEvent(fastForwardEvent); // for debug Console.WriteLine(JsonConvert.SerializeObject(fastForwardEvent)); fastForwardEvent = null; } else if (this.isPlaying && !forwardFlag && flag) { lock (EmotionModel.svmFeature) { EmotionModel.svmFeature[(int)VideoFeature.FASTFORWARD].Value = 1; } // 创建快进事件 fastForwardEvent = (FastForwardEvent)EventFactory.startPeriodEvent(curSession.SessionID, (int)mPlayer.GetPlayTime(), PeriodEventType.FAST_FORWARD); // for debug Console.WriteLine(JsonConvert.SerializeObject(fastForwardEvent)); forwardFlag = true; Thread t = new Thread(forward); t.Start(); } }
private void FastForwarded(FastForwardEvent e) { if (e.FastForwarding) { buttonImage.color = new Color(0.8f, 0.8f, 0.8f, 0.8f); } else { buttonImage.color = Color.white; } }
protected void Awake() { buttonImage = GetComponent <Image>(); if (buttonImage == null) { Debug.LogError($"{name} does not have an attached button component!"); } // Register listeners FastForwardEvent.RegisterListener(FastForwarded); }
protected void Awake() { PauseEvent.RegisterListener(LogEvent); MenuEvent.RegisterListener(LogEvent); TileSoldEvent.RegisterListener(LogEvent); TileDestroyedEvent.RegisterListener(LogEvent); TileDamageEvent.RegisterListener(LogEvent); TileUpdateEvent.RegisterListener(LogEvent); BaseDamageEvent.RegisterListener(LogEvent); BaseDamageUIEvent.RegisterListener(LogEvent); PurchaseMadeEvent.RegisterListener(LogEvent); PartsChangedUIEvent.RegisterListener(LogEvent); EnemyRecycledEvent.RegisterListener(LogEvent); GameStartEvent.RegisterListener(LogEvent); GameOverEvent.RegisterListener(LogEvent); GameWonEvent.RegisterListener(LogEvent); FastForwardEvent.RegisterListener(LogEvent); }
protected void OnDestroy() { FastForwardEvent.UnregisterListener(FastForwarded); }