public void OnPointerDown(PointerEventData eventData) { SoundManager.Play("ButtonClick"); if (GameManager.TutorialMode) { TutorialManager.hintSkill = true; GetComponent <Button>().enabled = false; } if (hintIsOpen) { last4DigitsText.gameObject.SetActive(true); last4NumbersText.gameObject.SetActive(true); last4PositionsText.gameObject.SetActive(true); HintText.gameObject.SetActive(false); hintIsOpen = false; } else { if (!hintCreated) { HintText.text = CreateHint(); } last4DigitsText.gameObject.SetActive(false); last4NumbersText.gameObject.SetActive(false); last4PositionsText.gameObject.SetActive(false); HintText.gameObject.SetActive(true); hintIsOpen = true; } }
private void HandleNote(Note.NoteType note) { if (note == Note.NoteType.Stop) { player.Stop(); } if (note == Note.NoteType.Run) { player.Run(); } if (note == Note.NoteType.Walk) { player.Walk(); } if (note == Note.NoteType.Jump) { jumpSfx.Play(); player.Jump(); } if (note == Note.NoteType.Reverse) { player.Reverse(); } }
public void OnPointerDown(PointerEventData data) { SoundManager.Play("ButtonClick"); TrainingButton.SetActive(true); OnlinePlayButton.SetActive(true); gameObject.SetActive(false); }
public void OnPointerDown(PointerEventData data) { SoundManager.Play("ButtonClick"); if (numBarText.text.Length < 4) { numBarText.text = numBarText.text + digit; } }
public void OnPointerUp(PointerEventData data) { if (PowerButton.power.Status != FreeMove.STATUS.Using) { Point.point = Point.point - GameManager.MovePoint[GameManager.MoveIndex]; if (PowerButton1.power.Status == Freeze.STATUS.Using) { pointText.text = ((int)Point.point).ToString(); } } if (int.Parse(playerNumberText.text) != GameManager.Number) { SoundManager.Play("OKButton"); int playerNumber = int.Parse(playerNumberText.text.Trim()); Fundamentals.Comparer.Compare(playerNumber, GameManager.Number); playerNumberText.text = ""; digitText.text = Fundamentals.Comparer.OnlyValue.ToString(); positionText.text = Fundamentals.Comparer.PlaceAndValue.ToString(); PushOldValues(playerNumber, Fundamentals.Comparer.OnlyValue, Fundamentals.Comparer.PlaceAndValue); UpdateLast4Values(); if (GameManager.TutorialMode) { TutorialManager.submit = true; } } else { if (GameManager.TutorialMode) { TutorialManager.submit = true; } if (MultiplayerGameManager.ConnectedToServer) { object[] param = { GameManager.Number, int.Parse(playerNumberText.text) }; GameObject.Find("MultiplayerGameManager").GetComponent <MultiplayerGameManager>() .SendMessageToServer("NumberFound", param); } SoundManager.Play("Win"); Point.gameStopped = true; EndGameScreen.SetActive(true); EndGameScreen.transform.Find("FailSuccessText").gameObject.GetComponent <Text>().text = "You find the number!\nScore : " + (int)Point.point; } }
public void OnPointerDown(PointerEventData data) { MultiplayerGameManager.CancelConnectingAttempt = true; GameObject.Find("MultiplayerGameManager").GetComponent <MultiplayerGameManager>().DisconnectFromServer(); MultiplayerTextBox.SetActive(false); soundButton.enabled = true; tutorialButton.enabled = true; SoundManager.Play("ButtonClick"); }
public void OnPointerDown(PointerEventData data) { SoundManager.Play("ButtonClick"); MultiplayerGameTextBox.SetActive(true); MultiplayerGameTextBox.transform.Find("CancelButton").gameObject.SetActive(true); Blocker.SetActive(true); if (MultiplayerGameManager.ConnectedToServer) { MultiplayerGameTextBox.transform.Find("MultiplayerText").GetComponent <Text>().text = "Go back to main menu? you will lose the game."; } else { MultiplayerGameTextBox.transform.Find("MultiplayerText").GetComponent <Text>().text = "Go back to main menu?"; Time.timeScale = 0; } }
void FixedUpdate() { // process message queue foreach (Message m in msgList) { switch (m.Type) { case "PlayerLeft": Time.timeScale = 0; MultiplayerGamePlayText.SetActive(true); MultiplayerGamePlayText.transform.Find("CalcelButton").gameObject.SetActive(false); MultiplayerGamePlayText.transform.Find("MultiplayerText").GetComponent <Text>().text = "Other player left the game. You win!"; TouchBlocker.SetActive(true); break; case "StartGame": SceneManager.LoadScene(1); break; case "FinishGame": Time.timeScale = 0; EndGameScreen.SetActive(true); if (m.GetBoolean(0)) { if (m.GetString(1) == myClient.ConnectUserId) { EndGameScreen.GetComponentInChildren <Text>().text = "You win!"; } else { EndGameScreen.GetComponentInChildren <Text>().text = "Other player win!"; SoundManager.Play("Lose"); } } else { EndGameScreen.GetComponentInChildren <Text>().text = "Ended in a draw!"; } break; case "GameFound": cancelButton.SetActive(false); MultiplayerText.text = "Game found.\nStarting..."; ConnectToGame(m.GetString(0)); break; } } // clear message queue after it's been processed msgList.Clear(); }
public void OnPointerDown(PointerEventData data) { SoundManager.Play("ButtonClick"); soundButton.enabled = false; tutorialButton.enabled = false; MultiplayerTextBox.SetActive(true); MultiplayerGameManager.CancelConnectingAttempt = false; if (!MultiplayerGameManager.ConnectedToServer) { mg.ConnectToServer(); } }
public override void SetLife(int l) { anim.SetTrigger("Hit"); Debug.Log("man dao"); base.SetLife(l); if (!isDead) { SoundFX.Play(); } gameManager.PlayerLife(life); gameObject.GetComponentInChildren <Weapon>().PreviousWapon(); }
public void OnPointerUp(PointerEventData data) { SoundManager.Play("Erase"); if (GameManager.TutorialMode) { TutorialManager.erase = true; GetComponent <Button>().enabled = false; } if (numText.text.Length > 0) { numText.text = numText.text.Substring(0, numText.text.Length - 1); } }
public void OnPointerDown(PointerEventData data) { if (SoundFX.Mute) { SoundManager.Play("ButtonClick"); GetComponent <Image>().sprite = soundActive; SoundFX.Mute = false; } else { GetComponent <Image>().sprite = soundDesactive; SoundFX.Mute = true; } }
public void OnPointerUp(PointerEventData data) { if (power.Status == Skill.STATUS.notUsed) { if (GameManager.TutorialMode) { TutorialManager.freezeSkill = true; GetComponent <Button>().enabled = false; } SoundManager.Play("ButtonClick"); tempPoint = pointText.text; power.Execute(ref tempPoint); pointText.text = tempPoint; } }
public void StartLevel() { board.Init(); ass_bgm.DOFade(0, 0); ass_bgm.DOFade(1, 1); sfx.Play(sfx.ac_gamestart); match_count = 0; level = 0; time_max = 15; beepped_time = 5; time = time_max; main_piece = new Piece(); main_piece_render.data = main_piece; GetNewPiece(); UpdateCamera(); }
public void MainLogicPass() { SoundManager.Play("ButtonClick"); TutorialTextBox.SetActive(false); TutorialManager.mainLogic = true; GetComponent <Button>().onClick.AddListener(PointPass); }
public void GoalReached() { levelEnded = true; goalSfx.Play(); }
public void AddCoin() { currentLevelCoins++; coins[currentLevel] = currentLevelCoins; coinSfx.Play(); }
public void PlayDeadSFX() { deadSfx.Play(); }
public void OnPointerDown(PointerEventData data) { SoundManager.Play("ButtonClick"); SceneManager.LoadScene(1); }