private IEnumerator Start() { InstanceMgr.Init(); SqliteManager.Init(); Application.targetFrameRate = 30; Resources.Load<ShaderVariantCollection>("Shader/ShaderVariants").WarmUp(); yield return null; LoaderScene.LoadNextLevel(new LoginScene()); } // end Start
} // end DeleteRole private void OnClickStartGameBtn() { if (!ChechExitID(roleindex)) { ObjectTool.InstantiateGo("MessageBoxUI", ResourcesTool.LoadPrefabUI("message_box_ui"), SceneManager.mainCanvas.rectTransform).AddComponent <UIMessageBox>().SetMessage("请选择角色"); return; } // end if GameManager.playerInfo.SelectedRole(roleindex, roleDict[roleindex][0], roleDict[roleindex][1]); LoaderScene.LoadNextLevel(new NoviceVillage()); } // end OnClickStartGameBtn
void Start() { _musicControl = FindObjectOfType <MusicControl>(); _loaderScene = FindObjectOfType <LoaderScene>(); _loaderScene.ShowLoadScreen(.5f, () => { // Inicializar por primera vez main menu FindObjectOfType <RappiMainMenu>().InitMenu(); }); }
public void ItemDown() { maxLives--; _lives.text = "Lives: " + maxLives; if (maxLives == 0) { _loaderScene = gameObject.AddComponent <LoaderScene>(); //_loaderScene = FindObjectOfType<LoaderScene>(); _loaderScene.LoadNextSceneByName("Game Over"); } }
} // end Act public void OnHrefClick(string name) { switch (name) { case GameConfig.FIGHT_SCENE: LoaderScene.LoadNextLevel(new FightScene()); break; case GameConfig.NOVICE_VILLAGE: LoaderScene.LoadNextLevel(new NoviceVillage()); break; default: SceneManager.uiPanelFMS.TransitionPrev(); break; } // end switch } // end OnHrefClick
/// <summary> /// 加载场景 /// </summary> /// <param name="level"></param> public void LoadLevel(SceneType level) { sceneType = level; if (loaderScene == null) { loaderScene = Game.GetScene <LoaderScene>(); } loaderPanel = panelMgr.CreatePanel(UI.PanelName.LoaderPanel) as LoaderPanel; loaderPanel.SetLoaderProgress(0); var scene = SceneManager.GetActiveScene(); SceneType currentLevel = (SceneType)scene.buildIndex; StartCoroutine(OnLoadLoaderLevel(currentLevel)); }
} // end OnClickRegisterBtn /// <summary> /// 点击登录按钮 /// </summary> void OnClickLoginBtn() { if (userNameInput.text == "" || userNameInput.text == null || passwordInput.text == "" || passwordInput.text == null) { ObjectTool.InstantiateGo("MessageBoxUI", ResourcesTool.LoadPrefabUI("message_box_ui"), SceneManager.mainCanvas.rectTransform).AddComponent<UIMessageBox>().SetMessage("请输入正确的账号密码!"); return; } // end if string msg = ""; string username = userNameInput.text; if (SqliteManager.CheckLogin(username, passwordInput.text, out msg)) { ConsoleTool.SetConsole(msg); GameManager.playerInfo.LoginGame(username); LoaderScene.LoadNextLevel(new SelectRoleScene()); return; } // end if ObjectTool.InstantiateGo("MessageBoxUI", ResourcesTool.LoadPrefabUI("message_box_ui"), SceneManager.mainCanvas.rectTransform).AddComponent<UIMessageBox>().SetMessage(msg); } // end OnClickLoginBtn
#pragma warning restore 649 void Start() { DontDestroyOnLoad(m_EventSystem); DontDestroyOnLoad(gameObject); m_MenuButton.onClick.AddListener(() => { LoaderScene.ResetDefaultWorld(); SceneManager.LoadScene(0, LoadSceneMode.Single); Destroy(gameObject); Destroy(m_EventSystem.gameObject); }); m_PreviousButton.onClick.AddListener(() => { Loader.LoadLevel(-1); }); m_NextButton.onClick.AddListener(() => { Loader.LoadLevel(1); }); m_ReloadButton.onClick.AddListener(() => { Loader.LoadLevel(0); }); OnSceneLoaded(SceneManager.GetActiveScene(), default); SceneManager.sceneLoaded += OnSceneLoaded; }
void Start() { _musicControl = FindObjectOfType <MusicControl>(); _loaderScene = FindObjectOfType <LoaderScene>(); }
/** * Start est appelé avant la première actualisation de la frame * Il va créer un panel pour joueur pour que ceci puissent voir son score. */ void Start() { loaderScene = GameObject.Find("LoaderScene").GetComponent <LoaderScene>(); buttons = new List <GameObject>(); buttons.Add(GameObject.Find("RestartButton")); buttons.Add(GameObject.Find("SelectionGameButton")); buttons.Add(GameObject.Find("QuitButton")); EventSystem.current.SetSelectedGameObject(buttons[idButtonSelect], null); LinkedList <CommunicationDeviceBLS> ldb = FinderDevicesBLS.Instance.GetListDevicesBLS(); if (ldb.Count == 0) { loaderScene.LoadLevelSelection(0); return; } // Vérification que tous les devices se sont arretés bool isDeviceStopped = true; while (isDeviceStopped) { isDeviceStopped = false; foreach (var device in ldb) { isDeviceStopped |= device.isRunning; } } float widthCanvas = canvas.GetComponent <RectTransform>().rect.width; float sizeXPanel = widthCanvas / ldb.Count; float x = (widthCanvas - sizeXPanel) / -2; float y = panelScorePlayer.transform.position.y; float z = panelScorePlayer.transform.position.z; foreach (var device in ldb) { Vector3 position = new Vector3(x, y, z); x += sizeXPanel; GameObject go = Instantiate(panelScorePlayer, position, Quaternion.identity); go.transform.SetParent(canvas.transform, false); GameObject namePlayer = go.transform.GetChild(0).gameObject; GameObject scorePlayer = go.transform.GetChild(2).gameObject; GameObject hitPlayer = go.transform.GetChild(4).gameObject; GameObject maxHit = go.transform.GetChild(6).gameObject; GameObject comboPlayer = go.transform.GetChild(8).gameObject; GameObject imagePlayer = go.transform.GetChild(9).gameObject; go.GetComponent <Image>().color = device.colorPlayer; namePlayer.GetComponent <Text>().text = device.surnameDevice; scorePlayer.GetComponent <Text>().text = PlayerPrefs.GetInt("HeroScore" + device.surnameDevice) + ""; hitPlayer.GetComponent <Text>().text = PlayerPrefs.GetInt("HeroNotesHit" + device.surnameDevice) + ""; maxHit.GetComponent <Text>().text = PlayerPrefs.GetInt("HeroNotesMax") + ""; comboPlayer.GetComponent <Text>().text = PlayerPrefs.GetInt("HeroHighstreak" + device.surnameDevice) + ""; imagePlayer.GetComponent <Image>().sprite = device.characterPlayer; } isFinishLoopCheck = true; }
/** * Start est appelé avant la première actualisation de la frame * Il va créer un panel pour joueur pour que ceci puissent voir son score. */ void Start() { loaderScene = GameObject.Find("LoaderScene").GetComponent <LoaderScene>(); buttons = new List <GameObject>(); buttons.Add(GameObject.Find("RestartGame")); buttons.Add(GameObject.Find("SelectionGameButton")); buttons.Add(GameObject.Find("QuitButton")); EventSystem.current.SetSelectedGameObject(buttons[idButtonSelect], null); LinkedList <CommunicationDeviceBLS> ldb = FinderDevicesBLS.Instance.GetListDevicesBLS(); int nbPlayer = ldb.Count; if (nbPlayer == 0) { loaderScene.LoadLevelSelection(0); return; } // Vérification que tous les devices se sont arretés bool isDeviceStopped = true; while (isDeviceStopped) { isDeviceStopped = false; foreach (var device in ldb) { isDeviceStopped |= device.isRunning; } } int widthCanvas = (int)canvas.GetComponent <RectTransform>().rect.width; int sizeXPanel = widthCanvas / nbPlayer; int x = (widthCanvas - sizeXPanel) / -2; int y = (int)panelScorePlayer.transform.position.y; int z = (int)panelScorePlayer.transform.position.z; foreach (var device in ldb) { Vector3 position = new Vector3(x, y, z); x += sizeXPanel; GameObject go = Instantiate(panelScorePlayer, position, Quaternion.identity); go.transform.SetParent(canvas.transform, false); GameObject namePlayer = go.transform.GetChild(0).gameObject; GameObject timePlayer = go.transform.GetChild(2).gameObject; GameObject goodHitPlayer = go.transform.GetChild(5).gameObject; GameObject badHitPlayer = go.transform.GetChild(7).gameObject; GameObject comboPlayer = go.transform.GetChild(9).gameObject; GameObject imagePlayer = go.transform.GetChild(10).gameObject; go.GetComponent <Image>().color = device.colorPlayer; namePlayer.GetComponent <Text>().text = device.surnameDevice; goodHitPlayer.GetComponent <Text>().text = PlayerPrefs.GetInt("RaceGoodHit" + device.surnameDevice) + ""; badHitPlayer.GetComponent <Text>().text = PlayerPrefs.GetInt("RaceBadHit" + device.surnameDevice) + ""; comboPlayer.GetComponent <Text>().text = PlayerPrefs.GetInt("RaceHighstreak" + device.surnameDevice) + ""; imagePlayer.GetComponent <Image>().sprite = device.characterPlayer; timePlayer.GetComponent <Text>().text = PlayerPrefs.GetInt("RaceFinish" + device.surnameDevice) == 1 ? ConvertSecondToMS((int)PlayerPrefs.GetFloat("RaceScore" + device.surnameDevice)) : "Undefined"; } isFinishLoopCheck = true; }