// Use this for initialization void OnEnable() { fireAmmunition = gameObject.GetComponentInChildren<FireAmmunition>(); if (null != fireAmmunition) { InvokeRepeating("shoot", 3, 2); } }
void Start() { fireAmmunition = GameObject.Find(NameContainer.PLAYER).gameObject.GetComponentInChildren <FireAmmunition>(); GameObject _fireForceBar = GameObject.Find(NameContainer.FIRE_FORCE_BAR); if (null != _fireForceBar) { fireForceBar = _fireForceBar.GetComponent <InfoBar>(); } }
void Awake() { player = gameObject.GetComponent <Player> (); playerMovement = gameObject.GetComponentInChildren <PlayerMovement> (); fireAmmunition = gameObject.GetComponentInChildren <FireAmmunition> (); animator = GetComponent <Animator>(); _particleSystem = GetComponent <ParticleSystem> (); if (null != _particleSystem) { _particleSystem.Stop(); } }