void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { SC_ShipController shipController = other.GetComponent <SC_ShipController>(); shipController.Respawn(); transform.parent.GetComponent <SC_AstroidController>().DestroyAstroid(this); } }
void OnTriggerEnter2D(Collider2D other) { if (!other.CompareTag("Player")) { return; } IsInside = true; if (ShipController == null) { ShipController = other.GetComponent <SC_ShipController>(); } }
void OnTriggerEnter2D(Collider2D other) { if (!other.CompareTag("Player") || !Interactable) { return; } SC_ShipController shipController = other.GetComponent <SC_ShipController>(); SC_Alternative alternative = shipController.GetFollower(); if (alternative != null) { SetFilling(alternative.GetText()); shipController.ClearFollower(); } }