//создаем LosePanel public void createLosePanel() { GameObject parent = UICamera.first.transform.parent.gameObject; //Створити Prefab GameObject obj = NGUITools.AddChild(parent, losePrefab); LosePanel popup = obj.GetComponent <LosePanel>(); // Time.timeScale = 0; }
public void SwithUIPanels(GameObject panel) { StartGamePanel.SetActive(false); GamePanel.SetActive(false); WinPanel.SetActive(false); LosePanel.SetActive(false); panel.SetActive(true); }
// Delay for display lose panel IEnumerator DisplayLosePanel() { MainPanel.SetActive(true); LosePanel.SetActive(true); AudioSource.PlayClipAtPoint(VoiceLose, new Vector3(0f, 0f, -10f)); yield return(new WaitForSeconds(VoiceLose.length + 1.5f)); MainPanel.SetActive(false); LosePanel.SetActive(false); }
public void WinLose() { if (counter.count > counter.allCount / 2) { WinPanel.SetActive(true); } else { LosePanel.SetActive(true); } }
public void StartOver() { LosePanel.SetActive(false); foreach (Transform obj in ShowCard) { obj.transform.parent = DiscardPile.transform; obj.transform.localPosition = new Vector2(0f, 0f); } Lose = false; round = 1; RoundStart(); }
void Awake() { losePanel = LosePanel.Instance(); //displayManager = DisplayManager.Instance(); levelManager = LevelManager.Instance(); scoreManager = ScoreManager.Instance(); myRestartAction = new UnityAction(RestartLevel); myQuitAction = new UnityAction(QuitToMainMenu); //myCancelAction = new UnityAction(Cancel); //myNextLevelAction = new UnityAction(NextLevel); }
public static LosePanel Instance() { if (!losePanel) { losePanel = FindObjectOfType(typeof(LosePanel)) as LosePanel; if (!losePanel) { Debug.LogError("There needs to be one active LosePanel script on a GameObject in your scene."); } } return(losePanel); }
public void ShowEndGamePanel(bool isWin) { Panel endGamePanel = new EndGamePanel(dataEndGamePanel); if (isWin) { _ = new WinPanel(endGamePanel, dataEndGamePanel); } else { _ = new LosePanel(endGamePanel, dataEndGamePanel, dataLose); } }
IEnumerator WaitAndOpenLosePanel() { if (TutorialCanvas != null) { if (TutorialCanvas.activeSelf) { TutorialCanvas.SetActive(false); } } yield return(new WaitForSeconds(1.5f)); LosePanel.SetActive(true); LeanCanvas.SetActive(false); }
IEnumerator WaitAndGameLose() { //SoundManager.Instance.StopAllSounds(); SoundManager.Instance.playSound(SoundManager.GameSounds.Lose); yield return(new WaitForSeconds(.5f)); if (PlayerPrefs.GetInt("VIBRATION") == 1) { TapticManager.Impact(ImpactFeedback.Light); } cubeManager.CloseAllCubeScripts(); LosePanel.SetActive(true); //InGamePanel.SetActive(false); }
public IEnumerator WaitAndGameLose() { SoundManager.Instance.playSound(SoundManager.GameSounds.Lose); yield return(new WaitForSeconds(1f)); if (PlayerPrefs.GetInt("VIBRATION") == 1) { TapticManager.Impact(ImpactFeedback.Light); } LosePanel.SetActive(true); //InGamePanel.SetActive(false); }
public IEnumerator WaitAndGameLose() { isGameOver = true; PeopleBarParent.SetActive(false); Destroy(BullAnimator.gameObject.GetComponentInParent <AutoMover>()); SoundManager.Instance.playSound(SoundManager.GameSounds.Lose); yield return(new WaitForSeconds(1f)); if (PlayerPrefs.GetInt("VIBRATION") == 1) { TapticManager.Impact(ImpactFeedback.Medium); } LosePanel.SetActive(true); }
public void SaveName() { string name = GetComponentInChildren <Text>().text; if (name.Length > 10) { name = name.Substring(0, 10); } string timerText = gameTimer.GetTimerString(); float timer = gameTimer.GetTimer(); rankingManager.GetComponent <RankingManager>().InsertNewScore(name, timerText, timer); GameObject.Find("Canvas/PanelInputName").SetActive(false); rankingManager.SetActive(true); LosePanel.SetActive(true); rankingManager.GetComponent <RankingManager>().LoadRankingUI(); }
private static void Transitions(bool on) { if (on != true) { transition.SetActive(false); fillColor = 0f; emptycolor = 1f; } else { transition.SetActive(true); if (fillColor <= aStartColor) { transition.GetComponent <Image>().color = new Vector4(rColor, gColor, bColor, fillColor); fillColor += 0.05f; } else { Moves(); Camera.myTransition = Transition.b4; if (myStep != Step.a10) { myStep = Step.a1; } else { LosePanel.ShowLosePanel(0, false); Camera.myTransition = Transition.b5; menu.SetActive(true); } if (emptycolor >= aEndColor) { transition.GetComponent <Image>().color = new Vector4(rColor, gColor, bColor, emptycolor); emptycolor -= 0.05f; } else { gameManeger.GetComponent <BoxCollider2D>().enabled = true; } } } }
// Update is called once per frame void Update() { Questions.text = questions[round - 1]; if (Lose) { LosePanel.SetActive(true); } if (myDeck.Count == 0) { myDeck = tempDeck; discardDeck.Clear(); foreach (Transform obj in DiscardPile) { Destroy(obj.gameObject); } Shuffle(); } }
void attack_RPC(string lastTouchSensor, string touchTargetSensor) { GameObject lastTouch = GameObject.Find(lastTouchSensor).GetComponent <SensorControl>().getCollisionObj(); GameObject touchTarget = GameObject.Find(touchTargetSensor).GetComponent <SensorControl>().getCollisionObj(); preSensor = lastTouchSensor; nowSensor = touchTargetSensor; lastTouch.transform.position = touchTarget.transform.position; lastMovedPosition = setMovePosition(touchTarget); moveSound(lastTouch); Destroy(touchTarget); if (nowTurn.Equals("Han")) { nowTurn = "Cho"; } else { nowTurn = "Han"; } if (touchTarget.name.Equals("Han_King(Clone)") || touchTarget.name.Equals("Cho_King(Clone)")) { if (touchTarget.name.Substring(0, 3).Equals(myTag)) // 패배 { aud.PlayOneShot(loseSound); LosePanel.SetActive(true); PlayingSound.SetActive(false); JangGoonSound.SetActive(false); } else // 승리 { aud.PlayOneShot(winSound); WinPanel.SetActive(true); PlayingSound.SetActive(false); JangGoonSound.SetActive(false); } } else { StartCoroutine("JangGoonCheck"); } }
public void onRabitDeath(HeroRabit rabit) { this.rabitLives -= 1; if (livesPanel != null) { this.livesPanel.setLivesQuantity(this.rabitLives); } if (this.rabitLives == 0) { //Знайти батьківський елемент GameObject parent = UICamera.first.transform.parent.gameObject; //Створити Prefab GameObject obj = NGUITools.AddChild(parent, losePanelPrefab); //Отримати доступ до компоненту (щоб передати параметри) LosePanel lose = obj.GetComponent <LosePanel>(); Time.timeScale = 0; } else { rabit.transform.position = this.startingPoint; } }
private void Update() { scoreText.text = "" + scoreInt; switch (myStep) { case Step.a1: Transitions(false); platforms = Instantiate(mPrefabPlatform); stick = Instantiate(mPrefabStick); myStep = Step.a0; break; case Step.a2: RotationStick(); break; case Step.a3: Check(); myStep = Step.a4; break; case Step.a4: Hero.Going(xPositionStartStick, centerPlatform + edgePlatform, isOnEndStick, isOnPlatform); // отправление кординат и куда идти можно убрать паблик break; case Step.a5: grow = 0; speed = 0; isOnPlatform = false; isOnEndStick = false; myStep = Step.a1; break; case Step.a6: RotationStick(); isOnPlatform = false; isOnEndStick = false; Hero.Going(0f, 0f, isOnEndStick, isOnPlatform); LosePanel.ShowLosePanel(scoreInt, true); break; case Step.a7: Transitions(true); LosePanel.ShowLosePanel(0, false); break; case Step.a8: Clear(); menu.SetActive(false); myStep = Step.a1; score.SetActive(true); break; case Step.a9: Transitions(false); score.SetActive(false); menu.SetActive(true); break; case Step.a10: Transitions(true); score.SetActive(false); break; case Step.a0: gameObject.GetComponent <BoxCollider2D>().enabled = true; break; } }
// Игрока уничтожили public void Lose() { Player.Enable = false; EnemyManager.Enable = false; losePanel = UiManager.EnablePanel <LosePanel>(); }
public override void Init(params object[] args) { base.Init(args); layer = PanelLayer.Panel; instance = this; }