// Update is called once per frame void EquipWeapon(CS_Weapon _weapon) { GameObject _weaponInst = Instantiate(_weapon.graphics, weaponHolder.position, weaponHolder.rotation); _weaponInst.transform.SetParent(weaponHolder); _weapon.bulletSpawn = _weaponInst.transform.Find("Fire Point"); currentWeapon = _weapon; currentGraphics = _weaponInst.GetComponent <CS_WeaponGraphics>(); currentGraphics.m_Collider.SetParent(transform.Find("Colliders")); GetComponent <NetworkTransformChild>().target = currentGraphics.m_Collider; }
// Update is called once per frame void Update() { currentWeapon = m_WeaponManager.GetCurrentWeapon(); if (CS_Pause.isOn) { CancelInvoke("Fire"); return; } Fire(); }
void Awake() { weapon = GetComponentInParent <CS_Weapon> (); targetTag = weapon.targetTag; }
void Awake() { weapon = GetComponentInChildren <CS_Weapon> (); }