void TriggerDown() { m_isHold = true; if (m_bow_state == Bow_State.Holding && Vector3.Distance(p_lefthand_transform.position, p_righthand_transform.position) < m_load_distance) { m_bow_state = Bow_State.Pulling; m_arrow.GetComponent <LineRenderer>().enabled = true; } }
void Fire() { m_arrow.GetComponent <LineRenderer>().enabled = false; this.GetComponent <AudioSource>().Play(); float power = Vector3.Distance(m_up_transform.position, p_righthand_transform.position) + Vector3.Distance(m_down_transform.position, p_righthand_transform.position) - Vector3.Distance(m_up_transform.position, m_down_transform.position); m_arrow.Fire(power * 3500.0f); m_arrow = null; m_bow_state = Bow_State.Waiting; Invoke("Create_Arrow", 0.25f); }
void Create_Arrow() { m_arrow = Instantiate(p_arrow_prefab); m_arrow.transform.SetParent(this.transform.parent.parent); m_bow_state = Bow_State.Holding; }