public void StartGame() { playerHealth = startPlayerHealth; PlayStatus = EnPlayStatus.None; LevelStatus = EnLevelStatus.Playing; StartGameAction?.Invoke(); }
void onClick() { Debug.Log("tapping"); if (startButtonPress) { Debug.Log("trying to invoke game start action"); StartGameAction?.Invoke(); } else if (quitButtonPress) { Application.Quit(); } }
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(); }
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(); } } }
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); }