public void ShowGuideBase(GuideBase data) { mask.SetActive(data.IsLocked); btnSkip.SetActive(data.IsShowSkip); UIEventListener.Get(btnSkip).onClick = (go) => { data.Finish(); }; }
private static void HousingGuideObject_Awake(ref GuideBase[] ___guide) { if (___guide.Length != 5 || ___guide[3] == null) { return; } // Housing.CraftCamera camera = new Housing.CraftCamera(); /* * Cinemachine.LensSettings settings = camera.lens; * settings.Orthographic = true; * * camera.lens = settings; * camera.moveSpeed = 15; */ GameObject rotationX = Instantiate(___guide[3].gameObject); rotationX.name = "X"; rotationX.transform.name = "X"; rotationX.transform.localScale = new Vector3(5, 5, 5); rotationX.transform.localEulerAngles = new Vector3(0, 0, 0); rotationX.transform.parent = ___guide[3].gameObject.transform.parent; rotationX.GetComponent <MeshRenderer>().material.color = Color.red; GuideRotation guideRotationX = rotationX.GetComponent <GuideRotation>(); guideRotationX.axis = GuideRotation.RotationAxis.X; guideRotationX.name = "X"; GameObject rotationZ = Instantiate(___guide[3].gameObject); rotationZ.name = "Z"; rotationZ.transform.name = "Z"; rotationZ.transform.localScale = new Vector3(5, 5, 5); rotationZ.transform.localEulerAngles = new Vector3(0, 270, 0); rotationZ.transform.parent = ___guide[3].gameObject.transform.parent; rotationZ.GetComponent <MeshRenderer>().material.color = Color.blue; GuideRotation guideRotationZ = rotationZ.GetComponent <GuideRotation>(); guideRotationZ.axis = GuideRotation.RotationAxis.Z; guideRotationZ.name = "Z"; GuideBase[] replacementGuide = new GuideBase[___guide.Length + 2]; for (int i = 0; i < ___guide.Length; i++) { replacementGuide[i] = ___guide[i]; } replacementGuide[___guide.Length] = guideRotationX; replacementGuide[___guide.Length + 1] = guideRotationZ; ___guide = replacementGuide; }
//切换副本类型后调用刷新 private void UpdateCopyPointByType() { //基本信息更新 string[] copypointId; copypointId = StringUtils.GetValueListFromString(BaseDataMgr.instance.GetSysDungeonTree(selectSubWorldId).list); SysMapVo copyPointInfo; for (int i = 0; i < copyPoints.Count; ++i) { copyPointInfo = BaseDataMgr.instance.GetMapVo(uint.Parse(copypointId[i])); copyPoints[i].FindChild("Name").GetComponent <UILabel>().text = copyPointInfo.name; copyPoints[i].FindChild("ditu/tu").GetComponent <UISprite>().spriteName = BaseDataMgr.instance.GetMapVo(uint.Parse(copypointId[i])).resource_id.ToString(); } //根据后端数据更新副本点信息 int grade, getStarsNum = 0; uint curTaskMapId; bool needGuide = false; for (int i = 0; i < copypointId.Length; ++i) { grade = Singleton <CopyPointMode> .Instance.GetStarNum(uint.Parse(copypointId[i])); getStarsNum += (grade > 0?grade:0); for (int j = 1; j <= 3; ++j) //更新副本星星获取数量 { copyPoints [i].FindChild("xx" + j).GetComponent <UISprite>().spriteName = j <= grade?"xingxing1":"kongxing"; } //更新副本开启状态 curTaskMapId = Singleton <TaskModel> .Instance.TaskCopyMapId; if (grade >= 0 || uint.Parse(copypointId[i]) == curTaskMapId) //开启该副本点 { copyPoints[i].GetComponent <BoxCollider>().enabled = true; copyPoints[i].FindChild("ditu/suo").gameObject.SetActive(false); copyPoints[i].FindChild("ditu/zhezao").gameObject.SetActive(false); copyPoints[i].FindChild("ditu/new").gameObject.SetActive(false); copyPoints[i].FindChild("ditu/tu").GetComponent <UISprite>().atlas = copyIconAtlas; copyPoints[i].FindChild("ditu/tu").GetComponent <UISprite>().depth = NORMAL_COPY_POINT_DEPTH; if (grade < 0 && uint.Parse(copypointId[i]) == curTaskMapId) { copyPoints[i].FindChild("ditu/new").gameObject.SetActive(true); } if (curTaskMapId <= 21002 && uint.Parse(copypointId[i]) == curTaskMapId && !GuideModel.Instance.IsShowGuide) { GuideCopyButton = copyPoints[i].GetComponent <Button>(); needGuide = true; } } else { copyPoints[i].GetComponent <BoxCollider>().enabled = false; copyPoints[i].FindChild("ditu/new").gameObject.SetActive(false); copyPoints[i].FindChild("ditu/suo").gameObject.SetActive(true); copyPoints[i].FindChild("ditu/zhezao").gameObject.SetActive(true); // UIUtils.ChangeGrayShader( copyPoints[i].FindChild("ditu/tu").GetComponent<UISprite>(), GRAY_COPY_POINT_DEPTH); copyPoints[i].FindChild("ditu/tu").GetComponent <UISprite>().atlas = copyIconGrayAtlas; copyPoints[i].FindChild("ditu/tu").GetComponent <UISprite>().depth = GRAY_COPY_POINT_DEPTH; } copyPoints[i].gameObject.SetActive(true); } grid.Reposition(); if (needGuide) { GuideBase copyGuide = GuideManager.Instance.GetGuideLogic(GuideType.GuideCopy); copyGuide.BeginGuide(); GuideManager.Instance.CurrentGuideType = GuideType.GuideCopy; } ActivedStarNum.text = getStarsNum + "/" + (copypointId.Length * 3); //更新该副本组已收集的星星数量 ActivedStar.fillAmount = (float)getStarsNum / (copypointId.Length * 3); isCollectAllStars = getStarsNum >= copypointId.Length * 3; ShowLoveGirl(); }
protected override void Render() { //如果是编辑环境,则可根据键盘按键来进行相应的移动 if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsWebPlayer) { //向上箭头键 if (Input.GetKeyDown(KeyCode.UpArrow)) { Singleton <ChatMode> .Instance.DataUpdate(Singleton <ChatMode> .Instance.UPDATE_UPARROW); } //向下箭头键 if (Input.GetKeyDown(KeyCode.DownArrow)) { Singleton <ChatMode> .Instance.DataUpdate(Singleton <ChatMode> .Instance.UPDATE_DOWNARROW); } if (AiController == null) { return; } if (Input.GetKeyDown(KeyCode.J)) //使用普通攻击 { addNormalAttack(false); } else if (GameConst.IS_NORMAL_COMBO_BY_PRESS_LONG && Status.IDLE == AppMap.Instance.me.Controller.StatuController.CurrentStatu && Input.GetKey(KeyCode.J)) { addNormalAttack(false); } if (Input.GetKeyDown(KeyCode.K)) //使用技能1 { AiController.SetAi(false); SkillController.RequestUseSkill(SkillController.Skill1); } if (Input.GetKeyDown(KeyCode.U)) //使用技能2 { AiController.SetAi(false); SkillController.RequestUseSkill(SkillController.Skill2); } if (Input.GetKeyDown(KeyCode.I)) //使用技能3 { AiController.SetAi(false); SkillController.RequestUseSkill(SkillController.Skill3); } if (Input.GetKeyDown(KeyCode.O)) //使用技能3 { AiController.SetAi(false); SkillController.RequestUseSkill(SkillController.Skill4); } if (Input.GetKeyDown(KeyCode.Space)) //使用瞬移 { AiController.SetAi(false); SkillController.RequestUseSkill(SkillController.Roll); } if (Input.GetKeyDown(KeyCode.X)) //使用AI, 测试用 { print("****MeControler, 使用AI, 测试用"); AiController.SetAi(true); } if (Input.GetKeyDown(KeyCode.BackQuote)) { #if UNITY_EDITOR GuideBase.TriggerGuideForTest(GuideType.GuideGoldBoxOpen); #endif /*#if UNITY_EDITOR * if (UnityEditor.EditorApplication.isPlaying) * { * UnityEditor.EditorApplication.isPaused = true; * } * else * { * UnityEditor.EditorApplication.isPaused = false; * } #endif*/ } float horizontal = Input.GetAxis("Horizontal"); float vertical = Input.GetAxis("Vertical"); if (horizontal > 0 || vertical > 0 || horizontal < 0 || vertical < 0) { AiController.SetAi(false); Vector2 speed = new Vector2(horizontal, vertical).normalized; int dir = Directions.GetDirByVector2(speed); BattleMode.Instance.IsLeft = dir == Directions.Left; BattleMode.Instance.IsRight = dir == Directions.Right; if (!MapMode.InStory) { MoveByDir(dir); } IsPressedMoveButton = true; AiController.SetAi(false); } else { BattleMode.Instance.IsLeft = false; BattleMode.Instance.IsRight = false; IsPressedMoveButton = false; } } }