コード例 #1
0
 void Awake()
 {
     player     = GetComponent <PlayerController>();
     state      = new IdleState(player);
     stateTimer = GetComponent <StateTimer>();
     cooldowns  = GetComponent <PlayerCooldowns>();
 }
コード例 #2
0
        private void SetUpClock()
        {
            stateTimer   = new StateTimer();
            programTimer = new ProgramTimer();

            stateTimer.StateTimeChanged     += StateTimer_StateTimeChanged;
            programTimer.ProgramTimeChanged += ProgramTimer_ProgramTimeChanged;
        }
コード例 #3
0
 /// <summary>
 /// Saves the current state time spent on.
 /// </summary>
 void SaveTimer()
 {
     StateTimer.Stop();
     if (StateTimer.ElapsedMilliseconds >= 1000)
     {
         TimerList.Add(new Tuple <string, double> (currentState, StateTimer.ElapsedSeconds));
     }
     StateTimer.Reset();
 }
コード例 #4
0
        private void SetTimer()
        {
            StateTimer.Interval = 60000;
            StateTimer.Tick    += (sender, e) =>
            {
                DatetoolStripStatusLabel.Text = DateTime.Now.ToLongDateString();
            };

            StateTimer.Start();
        }
コード例 #5
0
        /// <summary>
        /// Handles when navigation event has been thrown.
        /// </summary>
        /// <param name="evt">Evt.</param>
        void HandleNavigationEvent(NavigationEvent evt)
        {
            string NextEvent = evt.Name;

            if (!string.IsNullOrEmpty(currentState) && (NextEvent != currentState))
            {
                SaveTimer();
            }
            StateTimer.Start();
            currentState = NextEvent;
        }
コード例 #6
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     StateTimer.Stop();
     try
     {
         _ = _server.ShutDown();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #7
0
        /// <summary>
        /// Stop sensors interrogating & health tracking.
        /// </summary>
        public void Stop()
        {
            if (StateTimer == null)
            {
                Console.WriteLine("\nFitness tracker is not started yet!");
                return;
            }
            StateTimer.Change(Timeout.Infinite, Timeout.Infinite);

            Console.WriteLine("\nFitness tracker is stopped!");
            _isActive = false;
        }
コード例 #8
0
 /// <summary>
 /// Start sensors interrogating & health tracking.
 /// </summary>
 public void Run()
 {
     if (StateTimer == null)
     {
         StateTimer = new Timer(Sensors.CheckStatus,
                                state: null,
                                dueTime: CheckInteval,
                                period: CheckInteval);
     }
     else
     {
         StateTimer.Change(dueTime: CheckInteval,
                           period: CheckInteval);
     }
     _isActive = true;
 }
コード例 #9
0
 protected override void OnStop()
 {
     StateTimer.Dispose();
     th = null;
 }
コード例 #10
0
 protected override void OnStop()
 {
     Library.WriteErrorLog("test stop \n");
     StateTimer.Dispose();
 }
コード例 #11
0
 /// <summary>
 /// Dispose fitness tracker.
 /// </summary>
 public void Dispose()
 {
     StateTimer.Dispose();
     Sensors = null;
 }
コード例 #12
0
 protected override void OnStop()
 {
     WriteEventLogEntry("WindowsService2 Stop");
     Library.WriteErrorLog("Service Stop !!! \n");
     StateTimer.Dispose();
 }
コード例 #13
0
ファイル: AIController.cs プロジェクト: thormme/Chimera
 public AIController()
 {
     mDurdleTimer = new StateTimer<DurdleState>(DurdleState.Idle);
     ResetAIState();
 }
コード例 #14
0
 public NpcState()
 {
     Action    = CurrentAction.IdleStanding;
     _state    = new StateTimer();
     _movement = new MovementTimer();
 }