// Update is called once per frame void Update() { if (MGR.Get_instance().transform.GetChild((int)Enum.Managerlist.Player).transform.GetComponent <PlayerManagerScripts>().Get_Target() != null) { Debug.Log(Vector3.Distance(MGR.Get_instance().transform.GetChild((int)Enum.Managerlist.Player).transform.GetComponent <PlayerManagerScripts>().Get_Target().transform.position, this.gameObject.transform.position)); } if (SceneManager.GetActiveScene().name != "CharacterSelectScene") { if (MGR.Get_instance().transform.GetChild((int)Enum.Managerlist.Player).transform.GetComponent <PlayerManagerScripts>().Load_HP() <= 0) // 죽는다면 { state = 4; Anim.SetBool("Dead", true); UI.Get_Instance().transform.GetChild(13).gameObject.SetActive(true); } else { state = 0; Anim.SetBool("Dead", false); UI.Get_Instance().transform.GetChild(13).gameObject.SetActive(false); } if (state != 4) { if (Anim.GetCurrentAnimatorStateInfo(0).IsName("Base Layer.atk01") || Anim.GetCurrentAnimatorStateInfo(0).IsName("Base Layer.atk02") || Anim.GetCurrentAnimatorStateInfo(0).IsName("Base Layer.atk03")) { Weapon.transform.GetComponent <TrailRenderer>().enabled = true; } // 무기 트레일 기능 온 else { Weapon.transform.GetComponent <TrailRenderer>().enabled = false; } if (Target != null) { Target_Frame.SetActive(true); } MoveCtrl(); // 이동처리 if (MoveFlag == true) { Anim.SetBool("Walking", true); Anim.SetBool("Idle", false); } else { Anim.SetBool("Walking", false); Anim.SetBool("Idle", true); } InputKey(); // 스킬처리 } } }
// Start is called before the first frame update void Start() { MGR = new ManagerSingleton(); FC = new FollowCamera(); UI = new UISingleton(); bb = UI.Get_Instance().transform.GetChild(3).gameObject; ReturnOldScene d_s = new GameManagerScript().Get_OldScene; ReturnOldPosition d_p = new PlayerManagerScripts().Get_OldPosition; if (d_s() != null) { if (d_s() != null) { if (d_s() != SceneManager.GetActiveScene().ToString() || d_s() != null) { this.transform.position = d_p(); } } } Vector3 angles = this.transform.eulerAngles; Rotate = this.transform.forward.x; Anim = this.GetComponent <Animator>(); if (Target_Frame != null) { Target_Frame.SetActive(false); } MoveFlag = false; if (this.gameObject.transform.name == "Pirate") // 나중에 다른 캐릭터 추가되면 리소스로드로 Sprite 바꾸는거 추가... 19.08.15 { } }
void OnMenu() { NPCMenu.SetActive(true); UI.Get_Instance().transform.GetChild(5).transform.gameObject.SetActive(true); }
void Start() { Canvas = UI.Get_Instance().transform.GetChild(7).gameObject; }