Start() public method

public Start ( ) : void
return void
示例#1
0
        private void uiBtnStartStop_Click(object sender, EventArgs e)
        {
            /* Checks the button state */
            if (!(bool)uiBtnStartStop.Tag)
            {
                /* Creates a new timemanager istance */
                _timeManager = new TimeManager();
                /* Registers the callback */
                _timeManager.OnUpdateTime += _timeManager_OnUpdateTime;
                /* Starts the thread */
                _timeManager.Start();

                /* Changes the button properties */
                uiBtnStartStop.Tag  = true;
                uiBtnStartStop.Text = "STOP";
            }
            else
            {
                /* Stops the thread */
                _timeManager.Stop();
                /* Unregisters the callback */
                _timeManager.OnUpdateTime -= _timeManager_OnUpdateTime;
                _timeManager = null;

                /* Changes the button properties */
                uiBtnStartStop.Tag  = false;
                uiBtnStartStop.Text = "START";
            }
        }
示例#2
0
 public GameLogic(ref Board board)
 {
     m_board         = board;
     m_battleManager = new BattleManager();
     TimeManager.Start();
     ExamineBoardForTeams();
     currPlayer = p1;
 }
示例#3
0
        private void CustomInitialize()
        {
            Components.Initialize();

            timeManager         = new TimeManager();
            timeManager.Update += Update;
            timeManager.Start();
        }
示例#4
0
        public void SetHandAnimation(string clipName)
        {
            if (string.IsNullOrEmpty(clipName))
            {
                return;
            }

            TimeManager.Start(AnimationUtils.Play(_handAnimation, clipName, false));
        }
示例#5
0
 public MainWindow()
 {
     InitializeComponent();
     startButton.Width = menuScreen.Width;
     this.Width        = menuScreen.Width;
     this.Height       = menuScreen.Height;
     TimeManager.Start();
     menuScreen.MouseUp += new MouseButtonEventHandler(ChangeScreenClick);
 }
    protected override void OnOpen(object arg = null)
    {
        base.OnOpen(arg);

        tipsText.text = arg.ToString();

        TimeManager.Start((float t) =>
        {
            UIManager.Instance.CloseWidget("UITipsWidget");
        }, hideTime);
    }
 public static void StartCurrentTutorial()
 {
     if (currentTutorial != null)
     {
         if (string.IsNullOrEmpty(currentTutorial.sceneName) || SceneManager.GetActiveScene().name == currentTutorial.sceneName)                 // No scene need to load
         {
             currentTutorial.StartTutorial();
         }
         else
         {
             TimeManager.Start(LoadCurrentTutorialSceneCoroutine());
         }
     }
 }
        private void PlayButton_Click(object sender, EventArgs e)
        {
            if (TimeManager.IsRun())
            {
                TimeManager.Stop();

                Button btn = sender as Button;
                btn.Text = "Старт";
            }
            else
            {
                TimeManager.Start();

                Button btn = sender as Button;
                btn.Text = "Стоп";
            }
        }
示例#9
0
 // Start is called before the first frame update
 void Start()
 {
     player = PlayerData.GetInstance();
     tile   = TileManager.GetInstance();
     field  = FieldManager.GetInstance();
     map    = MapEventManager.GetInstance();
     time   = TimeManager.GetInstance();
     view   = new HeaderDataView();
     sl     = new SaveAndLoad();
     pm     = GetComponent <ParticleMaker>();
     tile.Start();
     field.Start();
     map.Start();
     time.Start();
     player.Start();
     key = GetComponent <ShortcutKey>();
     //sl.Save(0, new SaveData());
 }
示例#10
0
        public void TimeManagerEvent()
        {
            int timeOut = 100;

            using (ITimeManager timeManager = new TimeManager(timeOut / 2))
            {
                ManualResetEvent eventRaised = new ManualResetEvent(false);
                timeManager.Start();

                var isTrue = false;
                timeManager.Tick += (sender, e) =>
                {
                    eventRaised.Set();
                    isTrue = true;
                };
                eventRaised.WaitOne(timeOut);

                Assert.IsTrue(isTrue);
            }
        }
示例#11
0
 public void ToggleCharacter(bool isShown, string text = "", string animNameToPlay = "")
 {
     if (_characterGO != null)
     {
         _characterGO.SetActive(isShown);
         if (isShown)
         {
             _characterText.text = LocalizeUtils.Get(TermCategory.Tutorial, text);
             if (_characterAnim != null)
             {
                 if (_characterAnim.GetClip(animNameToPlay))
                 {
                     TimeManager.Start(AnimationUtils.Play(_characterAnim, animNameToPlay, false));
                 }
                 else
                 {
                     _characterAnim.Play();
                 }
             }
         }
     }
 }
示例#12
0
 public static void StartAllManagers()
 {
     Console.WriteLine("Starting TimeManager...");
     TimeManager.Start();
     Console.WriteLine("Started manager!");
 }