private void OnTriggerEnter2D(Collider2D collider) { //Debug.Log(collider.gameObject.tag); if (collider.gameObject.tag != shooterTag) { CLife cLife = collider.GetComponent <CLife>(); cLife.Damage(damage); } }
private void Awake() { rigidbody = GetComponent <Rigidbody2D>(); if (!life) { life = GetComponent <CLife>(); } if (!player) { player = GameController.instance.playerShip; } }