public void OpenWinPanel(bool win) { winPanel.SetActive(true); WinPanel script = winPanel.GetComponent <WinPanel>(); if (script == null) { Debug.Log("OpenWinPanel in Menubutton couldnt get reference to the win panel script."); } else { script.SetMovePanelIn(); } roundOver = true; DisableMenuButton(true); gScript.StopRoundTimer(); if (win == true) { subWinPanel.SetActive(true); long total = gScript.GetTimeTaken(); long minutes = total / 60; long seconds = total % 60; winTime.text = "You Earned Level " + pScript.GetCharLevel(charIndex).ToString() + " with " + pScript.GetCharName(charIndex) + "!"; winCoins.text = "" + gScript.GetLevelCoinsCollected().ToString() + "/" + gScript.GetLevelCoins(); } else { subWinPanel.SetActive(false); } }
private void Awake() { if (instance == null) { instance = this; } }
void Start() { #if UNITY_EDITOR editor = true; #endif Time.timeScale = 0; //You get the Rigidbody component you attach to the GameObject m_Rigidbody = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator> (); rend = GetComponent <SpriteRenderer>(); ft = FlashingText.ft; DP = DeathPanel.instance; WP = WinPanel.instance; UIP = UIPanel.instance; //Initialising the force which is used on GameObject in various ways m_JumpForce = new Vector3(0.0f, jumpStrength, 0.0f); m_DashForce = new Vector3(dashStrength, 0.0f, 0.0f); doublejump = PlayerPrefs.GetInt("double jump", 0); if (doublejump == 1) { print("doublejump unlocked"); } jumpStart = false; tRight = false; tLeft = false; }
public void Damage(int damage) { health += damage; // AdjustSize (); if (health <= 1) { if (cells.Contains(this)) { cells.RemoveAt(cells.IndexOf(this)); } for (int i = 0; i < diseases.Count; i++) { Disease.diseases--; } if (cells.Count < 1) { WinPanel.Win(); } print("Cell death"); Util.CheckForGameOver(); Destroy(gameObject); DiseaseButton.AddDisease(); return; } CalculateScale(); }
public void CloseMenu() { if (dontSoundOnStartUp == false && buyPanelActive == true) { audioOut.PlayOneShot(acClickOff, 0.8f); } else { dontSoundOnStartUp = false; } fpPanel.CloseFinalPanel(); //win panel can be called like this WinPanel script = winPanel.GetComponent <WinPanel>(); if (script == null) { Debug.Log("OpenWinPanel in Menubutton couldnt get reference to the win panel script."); } else { script.SetMovePanelOut(); } // move the canvas out backGroundFade.SetActive(false); //winPanel.SetActive(false); bPanel.SetMovePanelOut(); buyPanelActive = false; closeMenuOneShot = true; DisableMenuButton(false); gScript.PauseGame(false); }
public void createWinPanel() { isLevel1Complated = true; PlayerPrefs.SetInt("isLevel1Complated", 1); PlayerPrefs.Save(); //Знайти батьківський елемент GameObject parent = UICamera.first.transform.parent.gameObject; //Створити Prefab GameObject obj = NGUITools.AddChild(parent, winPanelPrefab); //Отримати доступ до компоненту (щоб передати параметри) WinPanel win = obj.GetComponent <WinPanel>(); win.setCoins(this.coins); win.setFruits(this.fruits, 1); win.setCrystal(this.crystalPanel.getObtainedCrystal(), 1); Time.timeScale = 0; collectedCoins += coins; PlayerPrefs.SetInt("collectedCoins", collectedCoins); if (isLevel1CrysralsCollected) { PlayerPrefs.SetInt("isLevel1CrysralsCollected", 1); } PlayerPrefs.Save(); }
public void RoundOverMenu() //calling from this function does the same as Open Menu, but disables the menu button until the player clicks new game button { //next make the button alpha channel faded // this doesnt appear to work Image img = GetComponent <Image>(); Color foo = img.color; foo.a = 128f; img.color = foo; //win panel can be called like this winPanel.SetActive(true); WinPanel script = winPanel.GetComponent <WinPanel>(); if (script == null) { Debug.Log("OpenWinPanel in Menubutton couldnt get reference to the win panel script."); } else { script.SetMovePanelOut(); } DisableMenuButton(false); roundOver = true; OpenMenu(); }
private void Start() { winPanel = FindObjectOfType <WinPanel>(); m_Win.SetActive(false); m_Borders.SetActive(true); goalCheck.Clear(); }
public void PlayButton() { WinPanel.SetActive(false); mainMenuPanel.SetActive(false); // when clicked on play button, then main menu panel should be deactivated gameMenuPanel.SetActive(true); // and game menu panel should set activated to true LevelManager.instance.GameStarted(); }
public void SwithUIPanels(GameObject panel) { StartGamePanel.SetActive(false); GamePanel.SetActive(false); WinPanel.SetActive(false); LosePanel.SetActive(false); panel.SetActive(true); }
public void ChangeLevel() { WinPanel.SetActive(false); startPanel.SetActive(true); level++; levelText.text = level.ToString(); life++; SceneManager.LoadScene("Level"); }
//создаем WinPanel public void createWinPanel() { GameObject parent = UICamera.first.transform.parent.gameObject; GameObject obj = NGUITools.AddChild(parent, winPrefab); WinPanel popup = obj.GetComponent <WinPanel>(); collectedMouses += mousesNumber; PlayerPrefs.SetInt("collectedMouses", collectedMouses); PlayerPrefs.Save(); // Time.timeScale = 0; }
public void WinLose() { if (counter.count > counter.allCount / 2) { WinPanel.SetActive(true); } else { LosePanel.SetActive(true); } }
private void Draw(System.Drawing.Color color, System.Drawing.Rectangle rect) { using (var myBrush = new System.Drawing.SolidBrush(color)) { using (var formGraphics = WinPanel.CreateGraphics()) { formGraphics.Clear(System.Drawing.Color.White); formGraphics.FillEllipse(myBrush, rect); } } }
void Update() { if (grid.extras.transform.childCount <= 0 && start) { start = false; WinPanel.SetActive(true); audioSource.clip = win; audioSource.Play(); Invoke("ChangeLevel", 2); } }
public static WinPanel Instance() { if (!winPanel) { winPanel = FindObjectOfType(typeof(WinPanel)) as WinPanel; if (!winPanel) { Debug.LogError("There needs to be one active WinPanel script on a GameObject in your scene."); } } return(winPanel); }
// Use this for initialization void Start() { button = GetComponent <Button>(); if (button == null) { Debug.Log("Tutorial OK Button script could not get a reference to the button sript."); } else { button.onClick.AddListener(NextTut); bbText = GetComponentInChildren <Text>(); if (bbText == null) { Debug.Log("Tutorial Ok button couldnt get reference to its own Text"); } } audioOut = GetComponent <AudioSource>(); if (audioOut == null) { Debug.Log("Tutorial OK Button couldnt get its Audio Source component."); } gScript = GameObject.FindGameObjectWithTag("GameController").GetComponent <LerpGameController>(); if (gScript == null) { Debug.Log("Tutorial Ok Button script could not get a reference to the game controller."); } pScript = GameObject.FindGameObjectWithTag("PlayerController").GetComponent <PlayerController>(); if (pScript == null) { Debug.Log("Tutorial OK Button script could not get a reference to the Player controller."); } tutPanel = GetComponentInParent <WinPanel>(); if (tutPanel == null) { Debug.Log("Tutorial Ok Button couldnt get a reference to its parent Win Panel Script"); } bPanel = GameObject.FindGameObjectWithTag("uiPanel").GetComponent <BuyPanelScript>(); if (bPanel == null) { Debug.Log("Open tutorial Button Couldnt Get reference to the ui Buy Panel"); } progress = 0; tutImage.sprite = tutImages[progress]; tuts.text = tutorials[progress]; bbText.text = buttonQuotes[progress]; }
public void MainMenu() { WinPanel.SetActive(false); LoosePanel.SetActive(false); StartPanel.SetActive(true); FireScript.GameOver = false; // GameObject.FindGameObjectWithTag("Cycle").SetActive(false); Destroy(GameObject.FindGameObjectWithTag("Cycle")); Destroy(GameObject.FindGameObjectWithTag("Swim")); Destroy(GameObject.FindGameObjectWithTag("Shoot")); Destroy(GameObject.FindGameObjectWithTag("Weight")); }
public void ShowEndGamePanel(bool isWin) { Panel endGamePanel = new EndGamePanel(dataEndGamePanel); if (isWin) { _ = new WinPanel(endGamePanel, dataEndGamePanel); } else { _ = new LosePanel(endGamePanel, dataEndGamePanel, dataLose); } }
void Awake() { menuPanel = MenuPanel.Instance(); winPanel = WinPanel.Instance(); 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); }
private void Update() { GameObject[] Obs = GameObject.FindGameObjectsWithTag("ObsO"); GameObject[] Ocircle = GameObject.FindGameObjectsWithTag("Ocircle"); if (Obs.Length == 0 && Ocircle.Length == 5) { Debug.Log("You WIn"); WinPanel.SetActive(true); } if (FireScript.GameOver) { LoosePanel.SetActive(true); } }
public void NewGame() { WinPanel.SetActive(false); foreach (Transform obj in DiscardPile) { Destroy(obj.gameObject); } Destroy(ShowCard.GetChild(0).gameObject); myDeck = tempDeck; Shuffle(); discardDeck.Clear(); round = 1; RoundStart(); }
private void Awake() { //actPanelObject is the Child Game Object underneat the FinalPlayPanel actPanelObject = GameObject.FindGameObjectWithTag("uiFinalActualPanel"); if (actPanelObject == null) { Debug.Log("Final Play Panel script couldnt get reference to the Final Actual Panel Game Object"); } else { actPanelObject.SetActive(true); } actPanel = gameObject.GetComponentInChildren <WinPanel>(); if (actPanel == null) { Debug.Log("Final Play Panel script couldnt get reference to the Win Panel script for the Actual Panel"); } else { actPanel.SetMovePanelOut(); } playButton = gameObject.GetComponentInChildren <PlayButton>(); if (playButton == null) { Debug.Log("FinalPlay Panel Script could not get reference to Play Button script"); } menuB = GameObject.FindGameObjectWithTag("MenuButton").GetComponent <MenuButton>(); if (menuB == null) { Debug.Log("FinalPLay Panel Script could not get reference to the Menu Button script."); } charSelectFinal = GameObject.FindGameObjectWithTag("uiCharSelectedFinal").GetComponent <Image>(); if (charSelectFinal == null) { Debug.Log("Final Play script couldnt get reference to the ui element for Character Selected"); } charNameFinal = GameObject.FindGameObjectWithTag("uiCurrentNameFinal").GetComponent <Text>(); if (charNameFinal == null) { Debug.Log("Final Play button script could not get a reference to the Buy Panel Character Name Text component."); } }
public static void CheckForGameOver() { print("Diseases yet: " + Disease.diseases); if (Disease.diseases <= 0) { int qtdDiseasesAvailable = 0; foreach (DiseaseButton dButton in DiseaseButton.buttons) { qtdDiseasesAvailable += dButton.GetUnits(); } print("Buttons yet: " + qtdDiseasesAvailable); if (qtdDiseasesAvailable == 0) { WinPanel.Lose(); } } }
public void Starbutton() { starHolder.SetActive(true); s1.color = Color.black; s2.color = Color.black; s3.color = Color.black; fakeBall.SetActive(false); inMenu = false; lose = false; win = false; WinPanel.SetActive(false); losePanel.SetActive(false); respawnManager.currentBall = 5; respawnManager.scoreMultipler = 1; respawnManager.score = 0; respawnManager.basketCount = 0; respawnManager.respawn1 = true; startPanel.SetActive(false); }
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 override void Init(params object[] args) { base.Init(args); layer = PanelLayer.Panel; instance = this; //ÔùËÍ300½ð±Ò PlayerData.AddGold(300); score.text = EntityManager.Instance.GetPlayerMinerEntity().score.ToString(); int starCount = EntityManager.Instance.GetPlayerMinerEntity().starCount; SetStarNumber(starCount); int GateLevel = PlayerPrefs.GetInt("DB_GateLevel"); if (GateLevel == DataManager.instance.PlayLV) { GateLevel++; PlayerPrefs.SetInt("DB_GateLevel", GateLevel); } }
public void Start() { winp = WinPanel.instance; if (SceneManager.GetActiveScene().name == "Ending Level") { currentLevel = SceneManager.GetActiveScene().name; print(currentLevel); gameSpeed = PlayerPrefs.GetInt("speed", 1); loadCharacter(PlayerPrefs.GetInt("Character", 0)); } if (SceneManager.GetActiveScene().name != "Menu" && SceneManager.GetActiveScene().name != "Ending Level") { currentLevel = SceneManager.GetActiveScene().name; Levelnumber = currentLevel.Substring(currentLevel.Length - 2); print(Levelnumber); Level = int.Parse(Levelnumber); PlayerPrefs.SetInt("Current Level", Level); gameSpeed = PlayerPrefs.GetInt("speed", 1); loadCharacter(PlayerPrefs.GetInt("Character", 0)); } }
// Update is called once per frame void FixedUpdate() { if (lose) { starHolder.SetActive(false); losePanel.SetActive(true); if (respawnManager.basketCount == 1 || respawnManager.basketCount == 0) { starpanel1.SetActive(true); starpanel2.SetActive(false); } if (respawnManager.basketCount == 2) { starpanel1.SetActive(false); starpanel2.SetActive(true); } loScore.text = "Score = " + respawnManager.score.ToString(); } if (win) { starHolder.SetActive(false); WinPanel.SetActive(true); wiScore.text = "Score = " + respawnManager.score.ToString(); } if (respawnManager.basketCount == 1) { s1.color = Color.white; } if (respawnManager.basketCount == 2) { s2.color = Color.white; } if (respawnManager.basketCount == 3) { s3.color = Color.white; } }
public void Win() //win panel { gameMenuPanel.SetActive(false); WinPanel.SetActive(true); GameManager.singleton.gameStatus = GameStatus.FAILED; }