private void Awake() { _shieldRed = GameObject.Find("ShieldRed"); _shieldBlue = GameObject.Find("ShieldBlue"); _shieldBlue.SetActive(false); _attackResource = gameObject.GetComponent <PlayerAttackResource>(); //ref to particle system _CastSpel_PS = this.gameObject.transform.GetChild(3).GetComponent <ParticleSystem>(); }
private ParticleSystem _CastSpel_PS; //Animator for the player private void Awake() { _movement = GetComponent <PlayerMovement>(); _body = GetComponent <Rigidbody2D>(); _shield = GetComponent <PlayerShield>(); _triggerCollision = transform.Find("CollisionDetection").GetComponent <PlayerTriggerCollision>(); _attackResource = GetComponent <PlayerAttackResource>(); //ref to animator to update when moving _animatorRED = this.gameObject.transform.GetChild(1).GetComponent <Animator>(); _animatorBLUE = this.gameObject.transform.GetChild(2).GetComponent <Animator>(); //ref to particle system _CastSpel_PS = this.gameObject.transform.GetChild(3).GetComponent <ParticleSystem>(); }
private void Start() { _attackResource = gameObject.GetComponentInParent <PlayerAttackResource>(); }
private void Start() { _attackResource = GameObject.Find("Player").GetComponent <PlayerAttackResource>(); }