// Main Menu Panel // Begins the game void StartGame() { MainMenuPanel.SetActive(false); LoadingPanel.SetActive(true); StartCoroutine(LoadAsynchronously(1, 2)); }
public void Resume() { gameObject.GetComponentInChildren <ProgressOficial>().Speed = 0; gameObject.transform.localScale = new Vector3(0, 0, 0); Time.timeScale = 1; ProgressSurvive.GetComponent <ProgressOficial>().Renew(); IsWatched = true; PlayerPrefs.SetString("Watched", "Yes"); LoadingPanel.SetActive(false); UIHandler.ContinueWithAd(Play, gameObject); }
// Start is called before the first frame update void Start() { // Determines which scene is open switch (SceneManager.GetActiveScene().name) { case "Main Menu": IsLoadingLevel = false; MainMenuPanel.SetActive(true); ControlsPanel.SetActive(false); CreditsPanel.SetActive(false); LoadingPanel.SetActive(false); MusicCreditsTitle.SetActive(false); MusicCredits.SetActive(false); ArtCreditsTitle.SetActive(false); ArtCredits.SetActive(false); ProgrammingCreditsTitle.SetActive(false); ProgrammingCredits.SetActive(false); GameDesignCreditsTitle.SetActive(false); GameDesignCredits.SetActive(false); TutorialIndex = 0; break; case "Gamefield": IsLoadingLevel = false; // Holds the amount of time which has elapsed Seconds = 60.0f; WaveInProgress = true; // Holds the wave of enemies Wave = 1; // Determines whether the lose conditions of the game has been met PlayerHasLost = false; Direction = 0; InitiateCameras(); SelectedBarracks = Barracks[0]; UIBarracksBlocked.SetActive(false); UIPrompt.gameObject.SetActive(false); Currency = 1000; SpawnGates = GameObject.FindGameObjectsWithTag("Spawn Gate"); AutoAttack = true; break; } }
void Start() { GameLogic.WaitFunc StartGame = delegate() { Count++; Slider.GetComponent <Slider>().value = Count; if (Count == 4) { LoadingPanel.SetActive(false); Deck.GetComponent <DeckObject>().StartGame(); } }; StartCoroutine(GameLogic.wait(1f, StartGame, 4)); if (IsTablet()) { this.LandScapeBackground.SetActive(true); } }
public void Restart() { LoadingPanel?.SetActive(true); GameManager.instance.ReloadScene(); }
public IEnumerator GetJSON() { //Add login and pass string WWW www = new WWW("http://vg2.v-galaktike.ru/api/?class=user&method=login&email=" + login_str + "&password="******"error"] == null) { LoginPanel.SetActive(false); if (isFirstLogin) { PlayerPrefs.SetString("userLogin", login_str); PlayerPrefs.SetString("userPass", pass_str); PlayerPrefs.Save(); } if (PlayerPrefs.HasKey("userLogin") && PlayerPrefs.HasKey("userPass")) { LoadingPanel.SetActive(true); } MainResourcesController.userId = error["user_id"].AsInt; MainResourcesController.userToken = error["token"].Value; WWW www_getuser = new WWW("http://vg2.v-galaktike.ru/api/?class=user&method=getuser&token=" + MainResourcesController.userToken); yield return(www_getuser); result = JSON.Parse(www_getuser.text); current_user = result["user"]; current_planet = result["system"]; game_config = result["game_config"]; system_list = result["system_list"]; statistic = result["stats"]; buildingsInProgress = current_planet["building"]; researchInProgress = current_user["tech"]; docDefInProgress = current_planet["weapon"]; GetValForJson(); mrc = TopBlock.GetComponent <MainResourcesController>(); mrc.ValOnTheirPlace(); mrc.repeatTick(); MainResourcesController.timeNow = result["now"].AsLong; MainResourcesController.weapone_update = current_planet["weapon_update"].AsLong; xmlParser.SetActive(true); } else { // Bad Login Or Pass login_field.transform.FindChild("Text").GetComponent <Text>().color = red; login_field.GetComponent <Image>().sprite = errorLogin_sprite; pass_field.transform.FindChild("Text").GetComponent <Text>().color = red; pass_field.GetComponent <Image>().sprite = errorLogin_sprite; errorText_go.SetActive(true); errorText_go.GetComponent <Text>().text = "Ошибка:\nЕмайл или пароль введены не верно."; } } else { Debug.Log(www.error); Error.SetActive(true); } }