void Start() { //background[Random.Range(0, 4)].SetActive(true); if (AsyLoadScene.sceneName == "MainCity") { background[5].SetActive(true); } else if (AsyLoadScene.sceneName == "MainMenu") { background[4].SetActive(true); } else { int index = PlayerData.CurrentLevelIndex % 4; if (index == -1) { background[0].SetActive(true); } else { background[index].SetActive(true); } } AsyLoadScene.LoadScene(); }
//开始游戏 public void StartGame() { if (PlayerData.CharacterName == "") { return; } follow.SetTarget(point1); load.SetActive(true); load.GetComponent <DOTweenAnimation>().DOPlayForward(); choose.GetComponent <DOTweenAnimation>().DOPlayBackwards(); AsyLoadScene.sceneName = "MainCity"; AsyLoadScene.LoadScene(); isLoad = true; tutorial.SetActive(false); }
void Update() { fill.GetComponent <Image>().fillAmount = AsyLoadScene.GetProgress(); if (fill.GetComponent <Image>().fillAmount >= 1.0f) { text.GetComponent <Text>().text = "正在进入游戏"; fill.GetComponent <Button>().interactable = true; EnterNextScene(); } else { text.GetComponent <Text>().text = "游戏正在载入"; fill.GetComponent <Button>().interactable = false; } }
public void EnterNextScene() { AsyLoadScene.EnterScene(); }