コード例 #1
0
ファイル: Logger.cs プロジェクト: M3L6H/DemolitionDefense
 private void LogEvent(FastForwardEvent e)
 {
     if (e.LoggingLevel <= LoggingLevel)
     {
         Debug.Log(e.Description);
     }
 }
コード例 #2
0
ファイル: VideoModule.cs プロジェクト: dingfeng/SmartPlayer
        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();
            }
        }
コード例 #3
0
 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;
     }
 }
コード例 #4
0
    protected void Awake()
    {
        buttonImage = GetComponent <Image>();

        if (buttonImage == null)
        {
            Debug.LogError($"{name} does not have an attached button component!");
        }

        // Register listeners
        FastForwardEvent.RegisterListener(FastForwarded);
    }
コード例 #5
0
ファイル: Logger.cs プロジェクト: M3L6H/DemolitionDefense
 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);
 }
コード例 #6
0
 protected void OnDestroy()
 {
     FastForwardEvent.UnregisterListener(FastForwarded);
 }