public override void ResetLevel() { base.ResetLevel(); foreach (GameObject ob in Buttons) { ob.SetActive(false); } ResetButton.SetActive(false); transform.Find("Validate").gameObject.SetActive(true); transform.Find("Next").gameObject.SetActive(false); foreach (Transform part in NameSelector.transform) { bool allowSwitchOff = part.GetComponent <ToggleGroup>().allowSwitchOff; if (allowSwitchOff == true || part.GetComponentsInChildren <Toggle>().Length > 1) { part.GetComponent <ToggleGroup>().allowSwitchOff = true; foreach (Toggle tog in part.GetComponentsInChildren <Toggle>()) { tog.isOn = false; } part.GetComponent <ToggleGroup>().allowSwitchOff = allowSwitchOff; } } Transform n = transform.Find("Name").Find("Text"); foreach (Transform go in n.transform) { Destroy(go.gameObject); } }
// --- Hides the Level Select --- public void hideMenu() { LoadingScreenUI.SetActive(true); mainMenuPanel.SetActive(false); ResetButton.SetActive(true); LoadingScreenUI.SetActive(false); }
public void StartButton() { NextButton.SetActive(true); PreviousButton.SetActive(true); ResetButton.SetActive(true); StartLevels.SetActive(false); string newLevel = levelPrefix + (++currentLevel); SceneManager.LoadScene(newLevel); }
public void hideWinBox() { LoadingScreenUI.SetActive(true); clearLevel(); winBoxUI.SetActive(false); mainMenuPanel.SetActive(true); levelButtons[levelUnlock].SetActive(true); ResetButton.SetActive(false); ResetLevel(); LoadingScreenUI.SetActive(false); }
/*public void Awake() * { * transform.localPosition = new Vector3(0, 0, 0); * * transform.GetComponent<Image>().enabled = false; * * LVM = GameObject.FindGameObjectWithTag("LevelManager").GetComponent<LevelManager>(); * Controls = GameObject.FindGameObjectWithTag("Controls"); * }*/ public override void ResetLevel() { base.ResetLevel(); transform.Find("ChargeSelector").GetComponent <ChargeSelectorManager>().Reset(); transform.parent.parent.GetComponent <resize>().InitResize(transform); BtnValidate.SetActive(true); Selector.ValidateChoice(false); Selector.Reset(); ResetButton.SetActive(false); Controls.SetActive(false); }
protected void Start() { var gs = Game.Instance.GameState; if (gs != null) { started = true; guiprovider = new GUIProvider(gs.Data); SaveButton.SetActive(gs.Data.isShowSaveLoad()); LoadButton.SetActive(gs.Data.isShowSaveLoad()); ResetButton.SetActive(gs.Data.isShowReset()); if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer) { this.GetComponent <UnityEngine.UI.CanvasScaler>().referenceResolution = new Vector2(600, 400); } } }
protected void Start() { var gs = Game.Instance.GameState; if (gs != null) { started = true; guiprovider = new GUIProvider(gs.Data); SaveButton.SetActive(gs.Data.isShowSaveLoad()); LoadButton.SetActive(gs.Data.isShowSaveLoad()); ResetButton.SetActive(gs.Data.isShowReset()); if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer) { this.GetComponent <UnityEngine.UI.CanvasScaler>().referenceResolution = new Vector2(600, 400); } /*Game.Instance.OnShowText += (finished, line, text, x, y, textColor, textOutlineColor, baseColor, outlineColor, id) => * { * if (!finished) * { * if (line != null) * { * Talk(line); * } * else if (textColor == Game.NoColor && textOutlineColor == Game.NoColor) * { * Talk(text, x, y, Color.white, Color.black); * } * else if(baseColor == Game.NoColor && outlineColor == Game.NoColor) * { * Talk(text, x, y, textColor, textOutlineColor); * } * else * { * Talk(text, x, y, textColor, textOutlineColor, baseColor, outlineColor); * } * } * };*/ } }
private void OnCollisionEnter(Collision hit) { if (hit.collider.CompareTag("Cars")) { if (HealthBar.MyInst.health >= 0) { while (true) { Decrease(0.2f); StartCoroutine(Blink()); int tilang = 5; GameManager.MyInst.score -= tilang; Notif.text = "menabrak Mobil Lain Score: -" + tilang.ToString(); DaftarPelanggaran.MyInstance.TilangPelanggaran(Notif.text, tilang); StartCoroutine(Clear()); break; } } } if (hit.collider.CompareTag("Palang")) { if (HealthBar.MyInst.health >= 0) { while (true) { Decrease(0.15f); StartCoroutine(Blink()); int tilang = 5; GameManager.MyInst.score -= tilang; Notif.text = "menabrak Palang Kereta APi Score: -" + tilang.ToString(); DaftarPelanggaran.MyInstance.TilangPelanggaran(Notif.text, tilang); StartCoroutine(Clear()); break; } } } if (hit.collider.CompareTag("Boundary")) { ResetButton.SetActive(true); } }
public void Start() { // --- Getting GameObjects --- rocketShip = GameObject.FindGameObjectWithTag("Player"); cameraScript = GameObject.FindGameObjectWithTag("MainCamera"); LoadingScreenUI = GameObject.FindGameObjectWithTag("LoadingScreen"); // --- Getting UI Gameobjects --- mainMenuPanel = GameObject.FindGameObjectWithTag("LevelMenu"); winBoxUI = GameObject.FindGameObjectWithTag("WinBoxUI"); levelButtons = GameObject.FindGameObjectsWithTag("LevelButtons"); ResetButton = GameObject.FindGameObjectWithTag("ResetButton"); for (int x = 1; x < levelButtons.Length; x++) { levelButtons[x].SetActive(false); } ResetButton.SetActive(false); winBoxUI.SetActive(false); LoadingScreenUI.SetActive(false); }