Exemplo n.º 1
0
    public GameObject nextBt;  //主页按钮

    /// <summary>
    /// 显示的时候
    /// </summary>
    private void Start()
    {
        int nowLevel = PlayerPrefUtil.GetNowLevel(); //当前关卡
        int nowMap   = PlayerPrefUtil.GetNowMap();   //当前地图

        int sumLevel = GameLevelUtil.sLevelNumArray[nowMap];

        if (nowLevel + 1 == sumLevel)
        {
            nextBt.SetActive(false);                                                        //失活
            homeBt.GetComponent <RectTransform>().anchoredPosition =
                new Vector2(-60, homeBt.GetComponent <RectTransform>().anchoredPosition.y); //重新定位
            retryBt.GetComponent <RectTransform>().anchoredPosition =
                new Vector2(60, retryBt.GetComponent <RectTransform>().anchoredPosition.y);
        }
    }
Exemplo n.º 2
0
 /// <summary>
 ///下一关
 /// </summary>
 public void NextLevel()
 {
     Time.timeScale = 1;                                           // timeScale 恢复正常
     PlayerPrefUtil.SetNowLevel(PlayerPrefUtil.GetNowLevel() + 1); //下一关
     SceneLoadUtil.LoadGameScene();                                //重新加载自己
 }