Пример #1
0
        public void StartGame()
        {
            playerHealth = startPlayerHealth;

            PlayStatus  = EnPlayStatus.None;
            LevelStatus = EnLevelStatus.Playing;

            StartGameAction?.Invoke();
        }
Пример #2
0
 void onClick()
 {
     Debug.Log("tapping");
     if (startButtonPress)
     {
         Debug.Log("trying to invoke game start action");
         StartGameAction?.Invoke();
     }
     else if (quitButtonPress)
     {
         Application.Quit();
     }
 }
Пример #3
0
 private void ConfirmDeck()
 {
     Client.Instance.Proxy.OnSendBuildInfo(CurrentEditBuildButton.BuildInfo);
     NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("Notice_SelectBuildManagerSelect_UpdateDeckSuccess"), 0, 1f);
     if (CurrentSelectedBuildButton)
     {
         CurrentSelectedBuildButton.IsSelected = false;
     }
     CurrentSelectedBuildButton            = CurrentEditBuildButton;
     CurrentSelectedBuildButton.IsSelected = true;
     CloseUIForm();
     StartGameAction?.Invoke();
 }
Пример #4
0
        void SetShip(Point point)
        {
            currentShip.AddPoint(point);
            SetEnabledPoints(currentShip);

            if (currentShip.Initialized)
            {
                if (currentShip.IsVertical)
                {
                    var top    = Buttons.First(n => n.Coordinates() == currentShip.Top);
                    var bottom = Buttons.First(n => n.Coordinates() == currentShip.Bottom);
                    top.Text    = "⎯";
                    bottom.Text = "⎯";
                }
                else
                {
                    var left  = Buttons.First(n => n.Coordinates() == currentShip.Left);
                    var right = Buttons.First(n => n.Coordinates() == currentShip.Right);
                    left.Text  = "|";
                    right.Text = "|";
                }

                currentShip = ships.FirstOrDefault(n => !n.Initialized);
                if (currentShip == null)
                {
                    Buttons.ForEach(n =>
                    {
                        n.IsEnabled       = true;
                        n.Clicked        -= SetShip;
                        n.Clicked        += Hit;
                        n.BackgroundColor = Color.White;
                    });
                    NotifyOfPropertyChange(() => Initialized);
                    StartGameAction?.Invoke();
                }
                else
                {
                    EnableEmpty();
                }
            }
        }
Пример #5
0
    IEnumerator Start()
    {
        timerImage.gameObject.SetActive(true);
        float timeRemaining = CountdownTime;

        while (timeRemaining > 0)
        {
            yield return(EndOfFrame);

            timeRemaining -= Time.deltaTime;

            //interpolate timer image's fill amount from 1 to 0 over CountdownTime seconds
            timerImage.fillAmount = timeRemaining / CountdownTime;

            //change timer display text to show timeRemaining (rounded up)
            timerDisplay.text = Mathf.CeilToInt(timeRemaining).ToString();
        }

        StartGameAction?.Invoke();
        gameObject.SetActive(false);
    }