protected override void Awake() { base.Awake(); bullet = transform.Find("Bullet").gameObject; bullet.SetActive(false); trigger = transform.FindChild("TriggerHolder").gameObject; slide = transform.FindChild("Slide").GetComponent <RealGun_Slide>(); slideRigidbody = slide.GetComponent <Rigidbody>(); slideCollider = slide.GetComponent <Collider>(); safetySwitch = transform.FindChild("SafetySwitch").GetComponent <RealGun_SafetySwitch>(); safetySwitchRigidbody = safetySwitch.GetComponent <Rigidbody>(); safetySwitchCollider = safetySwitch.GetComponent <Collider>(); }
protected override void Awake() { base.Awake(); bullet = transform.Find("Bullet").gameObject; bullet.SetActive(false); trigger = transform.FindChild("TriggerHolder").gameObject; slide = transform.FindChild("Slide").GetComponent<RealGun_Slide>(); slideRigidbody = slide.GetComponent<Rigidbody>(); slideCollider = slide.GetComponent<Collider>(); safetySwitch = transform.FindChild("SafetySwitch").GetComponent<RealGun_SafetySwitch>(); safetySwitchRigidbody = safetySwitch.GetComponent<Rigidbody>(); safetySwitchCollider = safetySwitch.GetComponent<Collider>(); }