using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.SceneManagement;using UnityEngine.UI;/// /// 关卡框架选择 —— 用来控制关卡的解锁与否/// public class FrameSelect : MonoBehaviour{ public int StarNum; //行星数量 public bool isSelect; //是否可选 public GameObject LocksGameObject; //枷锁 public GameObject StarsGameObject; //星星 public GameObject AllFramePanel; //所有选关界面 public GameObject MapLevelPanel; //关卡界面 private Button SelectButton; //按钮组件 public Text LevelStarsText; //关卡星星数量 public int LevelStarNum = 0; //关卡开始数量 public int LevelEndCount = 2; //关卡结束数量 void Start() { //PlayerPrefs.DeleteAll(); SelectButton = GetComponent
2
MapLevel —— 关卡页面脚本
用来控制每个关卡的解锁,和跳转到游戏场景
using UnityEngine;using UnityEngine.SceneManagement;using UnityEngine.UI;/// /// 关卡选择脚本/// public class MapLevel : MonoBehaviour{ public bool isSelect; //可选状态 public Sprite LevelSprite; //替换关卡图 private Image LeveLImage; //UI关卡图组件 public GameObject AllFramePanel; //选关场景界面 private Button BackButton; //返回按钮 public GameObject[] Stars; //星星数组 public string BiaoShiString; //标示 public bool isDevelop; //是否开发 private void Awake() { LeveLImage = GetComponent(); } void Start() { BackButton = transform.parent.parent.transform.Find("Map1_BackButton").GetComponent