// Update is called once per frame void Update() { Debug.Log(status.HP); ATBBar.SetATBBarValue(ATBBar.GetATBBarValue() + 1.0f / finalATBSpeed * Time.deltaTime); if (ATBBar.GetATBBarValue() == 1f) { basicMenu.SetActive(true); cursor.SetActive(true); audioSource.PlayOneShot(ATBFilled); } }
// Update is called once per frame void Update() { if (cursor == null) { cursor = GameObject.FindGameObjectWithTag("Cursor"); } cursorS = cursor.GetComponent <Cursor>(); if (Input.GetButtonDown("Submit") && cursor.activeSelf) { audioSource.PlayOneShot(selectSFX); Debug.Log(TargetSelect().name); switch (actionType) { case "Attack": Attack.ATK(GameObject.Find("PlayerCha1").GetComponent <Status>().STR, TargetSelect()); ATBBar.SetATBBarValue(0f); GameObject.Find("BasicActions").SetActive(false); cursor.SetActive(false); break; case "Skills": ATBBar.SetATBBarValue(0f); GameObject.Find("SkillMenu").SetActive(false); GameObject.Find("BasicActions").SetActive(false); cursor.SetActive(false); break; case "Magics": ATBBar.SetATBBarValue(0f); GameObject.Find("MagicMenu").SetActive(false); GameObject.Find("BasicActions").SetActive(false); cursor.SetActive(false); break; case "Items": ATBBar.SetATBBarValue(0f); GameObject.Find("ItemMenu").SetActive(false); GameObject.Find("BasicActions").SetActive(false); cursor.SetActive(false); break; } } }
void Awake() { hpBar = this.GetComponentInChildren<HPBar> (); atbBar = this.GetComponentInChildren<ATBBar>(); mpBar = this.GetComponentInChildren<MPBar>(); playerNameText = this.GetComponentInChildren<PlayerNameText> (); }
void Awake() { anim = this.GetComponent<Animator>(); agent = this.GetComponent<NavMeshAgent>(); hpBar = this.GetComponentInChildren<HPBar>(); monsterAI = this.GetComponent<MonsterAI>(); atbBar = this.GetComponentInChildren<ATBBar>(); state = new BattleState(); state.setState(BattleState.State.Idle); setAnim(); }