private void Awake() { guiManager = FindObjectOfType <GUIManager>(); playerAim = GetComponentInParent <PlayerAim>(); gunEffect = GetComponent <GunEffect>(); AddAmmo(0); }
private void EffectTools_OnEffectCreated(AnimationEffect animationEffect) { timeOfDraw = Time.time; GunEffect gunEffect = animationEffect.effect.GetComponent <GunEffect>(); EffectTools gunEffectTools = gunEffect.GetComponent <EffectTools>(); gunEffect.transform.position = transform.GetChild(0).position; gunEffect.transform.rotation = transform.rotation; gunEffect.transform.localScale = transform.localScale; gunEffect.dispatcher.OnDispatch += Dispatcher_OnDispatch; }