void OnEnable() { _renderer = transform.GetComponent <Image>(); ShowMissionNumber(); //获取当前标记的关卡数 int mark = MyKeys.GetNameToInt(transform.name); if (mark <= MyKeys.MissionMaxIndex) { //通过的关卡,修改shader if (mark <= MyKeys.PassMission + 1) { _is_Lock = true; } else { _is_Lock = false; SetMissionDark(); return; } //星星实例设置部分 SetStars(); } else { _is_Lock = false; SetMissionDark(); } }
IEnumerator Wait() { yield return(0); //初始化最高分数属性的关键字 MyKeys.Top_Score_Key = MyKeys.MissionName.ToString(); //为最高分赋值,属性内会自己判断分数是否更新 MyKeys.Top_Score = MyKeys.Game_Score; //检测是否为导航关卡 if (GuidanceBase.GuidanceMark == 0) { GuidanceBase.GuidanceMark = 1; } //通过关卡加一点体力 TimeManager.ResetTime(); //增加金币 MyKeys.Gold_Value += MyKeys.Game_Score; //开始播放动效 int stars = StartEffect(); //增加钻石 AddDiamond(stars); //保存过关最大星数 MyKeys.PassStarsMax = stars; //保存此关卡通过状态 MyKeys.PassMission = MyKeys.GetNameToInt(MyKeys.MissionName.ToString()); //初始化属性 Cut_Number = 0; //显示分数 Score(); UMManager.FinishMission(MyKeys.MissionName.ToString()); }
/// <summary> /// 显示当前未通过的导航,并隐藏其他导航组件 /// </summary> /// <param name="guidance_Transform"></param> private void ShowCurrentGuidance(Transform guidance_Transform) { int index = MyKeys.GetNameToInt(guidance_Transform.name); if (GuidanceMark + 1 == index) { guidance_Transform.gameObject.SetActive(true); } else { guidance_Transform.gameObject.SetActive(false); } }