override public void Exit(PlayerRoot pr = null) { //ボタンを初期位置に戻す pr.StartCoroutine(pr.LerpMove(pr.btn, pr.btn.transform.localPosition, btnTempPos, 1)); pr.p_jb.HideSkillBtn(); }
override public void Exit(PlayerRoot pr = null) { if (pr.previous_controller == KirenControl.Instance) { TutorialRoot.Instance.msg = "「そのままノエルの魔法で魔物に攻撃だ!」"; } else { TutorialRoot.Instance.msg = ""; } PlayerRoot.Instance.DestroyObj(yajirusi); //ボタンを初期位置に戻す pr.StartCoroutine(pr.LerpMove(pr.btn, pr.btn.transform.localPosition, btnTempPos, 1)); pr.p_jb.HideSkillBtn(); }
override public void Excute(PlayerRoot pr = null) { // ボタンがなければ if (pr.btn == null) { pr.ChangeMode(BattelMode.Instance); } #region マウス操作 if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, Mathf.Infinity, d_layerMask)) { switch (hit.collider.gameObject.layer) { case 8: //Player pr.p_jb.HideSkillBtn(); pr.p_jb = hit.collider.gameObject.GetComponent <JobBase>(); pr.p_jb.ShowSkillBtn(); pr.ChangeMode(BattelMode.Instance); break; case 10: //Command // 選択したボタンを保管 pr.btn = hit.collider.gameObject; pr.s_script = pr.btn.GetComponent <SkillScript>(); btnTempPos = pr.btn.transform.localPosition; break; case 14: //Yousei // 選択したボタンを保管 pr.p_jb.HideSkillBtn(); pr.p_jb = hit.collider.gameObject.GetComponentInParent <JobBase>(); pr.btn = hit.collider.gameObject; pr.s_script = pr.btn.GetComponent <SkillScript>(); btnTempPos = pr.btn.transform.localPosition; break; } } } if (Input.GetMouseButton(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask)) { Debug.Log(hit.collider.gameObject.name); if (pr.btn != null) { // ボタンを動かす Vector3 pos = hit.point; if (hit.collider.gameObject.layer == LayerMask.NameToLayer("Ground")) { pos.y += 0.2f; } pr.btn.transform.position = pos; } } } if (Input.GetMouseButtonUp(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, Mathf.Infinity, u_layerMask)) { if (pr.btn != null) { if (pr.s_script.s_targetNum != TargetNum.SELF) { //レイヤーが同じなら if (hit.collider.gameObject.layer != LayerMask.NameToLayer("Ground")) { SkillUse(pr, hit.collider.gameObject, pr.btn, pr.s_script.s_effectTime); } else//ボタンを初期位置に戻す { pr.StartCoroutine(pr.LerpMove(pr.btn, pr.btn.transform.localPosition, btnTempPos, 1)); } } // SELFなら、即発動 else { SkillUse(pr, pr.p_jb.gameObject, pr.btn, pr.s_script.s_effectTime); } } } else//ボタンを初期位置に戻す { pr.StartCoroutine(pr.LerpMove(pr.btn, pr.btn.transform.localPosition, btnTempPos, 1)); } } if (Input.GetMouseButtonDown(1)) { pr.ChangeMode(BattelMode.Instance); } #endregion pr.CheckEndBattel(); pr.CheckGameOver(); }
override public void Excute(PlayerRoot pr = null) { // ボタンがなければ if (pr.btn == null) { pr.ChangeMode(BattelMode.Instance); } #region マウス操作 if (Input.GetMouseButton(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask)) { if (pr.btn != null) { // ボタンを動かす Vector3 pos = hit.point; if (hit.collider.gameObject.layer == LayerMask.NameToLayer("Ground")) { pos.y += 0.2f; } pr.btn.transform.position = pos; } } } if (Input.GetMouseButtonUp(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, Mathf.Infinity, u_layerMask)) { if (pr.btn != null) { if (pr.s_script.s_targetNum != TargetNum.SELF) { //レイヤーが同じなら if (hit.collider.gameObject.layer != LayerMask.NameToLayer("Ground")) { if (pr.previous_controller == KiraControl.Instance && hit.collider.gameObject.GetComponent <JobBase>()._type == JobType.Attacker) { SkillUse(pr, hit.collider.gameObject, pr.btn, pr.s_script.s_effectTime); } if (pr.previous_controller == KirenControl.Instance && hit.collider.gameObject.GetComponent <JobBase>()._type == JobType.Magician) { SkillUse(pr, hit.collider.gameObject, pr.btn, pr.s_script.s_effectTime); } if (pr.previous_controller == YumaControl.Instance) { SkillUse(pr, hit.collider.gameObject, pr.btn, pr.s_script.s_effectTime); } if (pr.previous_controller == Kiren2Control.Instance && hit.collider.gameObject.GetComponent <StatusControl>()._type == JobType.Magician) { SkillUse(pr, hit.collider.gameObject, pr.btn, pr.s_script.s_effectTime); } } else { //ボタンを初期位置に戻す pr.StartCoroutine(pr.LerpMove(pr.btn, pr.btn.transform.localPosition, btnTempPos, 1)); } } // SELFなら、即発動 else { SkillUse(pr, pr.p_jb.gameObject, pr.btn, pr.s_script.s_effectTime); } } } else//ボタンを初期位置に戻す { pr.StartCoroutine(pr.LerpMove(pr.btn, pr.btn.transform.localPosition, btnTempPos, 1)); } } #endregion pr.CheckEndBattel(); pr.CheckGameOver(); }