// void Start() // { //#if UNITY_EDITOR // var backButtonPrefab = Resources.Load<GameObject>("BackButton"); // var backButton = Instantiate(backButtonPrefab, transform); // if (backButton == null) // Debug.LogError("Failed to load BackButton!"); // backButton.transform.SetParent(transform); // backButton.GetComponent<Button>().onClick.AddListener(() => { SceneTranlater.LoadSceneByCount(0); }); //#endif // } #if UNITY_EDITOR || UNITY_STANDALONE_WIN private void Update() { if (Input.GetKeyDown(KeyCode.B)) { SceneTranlater.LoadSceneByCount(0); } }
public void NextStage() { int index = SceneTranlater.GetCurrentBuildIndex(); if (index < 4) { SceneManager.LoadScene(index + 1); } }
private void Start() { int index = SceneTranlater.GetCurrentBuildIndex(); objs[Mathf.Clamp(index - 2, 0, objs.Count - 1)].SetActive(true); if (index == (int)SceneIndex.THIRD) { StartCoroutine(BecomeLarger()); //第三关UI变大 } m_rankImage.sprite = m_rankSprites[ScoreManager.Instance.GetRank()]; }