private void Unequip() { if (m_LeftWeapon != null) { m_LeftScript.Deequip(); m_LeftScript = null; m_LeftWeapon.transform.position = transform.position; m_LeftWeapon = null; } }
private void pickUpWeapon(SocketWeapon newWeapon) { Debug.Log("can pick up weapon"); if ((Input.GetButtonDown(m_controller.m_LeftEquipKey))||Input.GetKey(m_EquipSocket)) { Debug.Log("picking up weapon"); if ((m_LeftWeapon != null)&&(m_LeftScript!=newWeapon)) { Unequip(); } Debug.Log("picking up" + newWeapon.gameObject.name); newWeapon.m_socketJoint.parent = m_socketLoc.transform; newWeapon.m_socketJoint.localPosition = new Vector3(); newWeapon.Equip(gameObject); m_LeftScript = newWeapon; m_LeftWeapon = newWeapon.gameObject; } }