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);
        }
    }
示例#2
0
    // --- 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);
    }
示例#4
0
    public void hideWinBox()
    {
        LoadingScreenUI.SetActive(true);

        clearLevel();
        winBoxUI.SetActive(false);
        mainMenuPanel.SetActive(true);
        levelButtons[levelUnlock].SetActive(true);
        ResetButton.SetActive(false);
        ResetLevel();

        LoadingScreenUI.SetActive(false);
    }
示例#5
0
    /*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);
    }
示例#6
0
        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);
                }
            }
        }
示例#7
0
        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);
                 *      }
                 *  }
                 * };*/
            }
        }
示例#8
0
 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);
     }
 }
示例#9
0
    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);
    }