private void OnTriggerEnter2D(Collider2D collision) { if ((collision.gameObject != shooter)) { FFS_BulletController cousin = collision.gameObject.GetComponent <FFS_BulletController>(); if (cousin == null) { FFS_CharacterStats livingObject = collision.gameObject.GetComponent <FFS_CharacterStats>(); if (livingObject != null) { livingObject.TakeDamage(damage); } Destroy(this.gameObject); } } }
private void Awake() { enemyStats = GetComponent <FFS_CharacterStats>(); transformComponent = transform; }