private void OnTriggerExit2D(Collider2D collision) { if (collision.GetComponentInParent <Controller>()) { Controller player = collision.GetComponentInParent <Controller>(); triggeredPlayers.Remove(player); player.isTriggeringCharacterCustomizer = false; CustomizerController controller = player.GetComponent <CustomizerController>(); controller.customization = null; if (isInUse) { return; } if (triggeredPlayers != null) { if (triggeredPlayers.Count >= 1) { Setup(triggeredPlayers[0]); return; } } uiDisplay.SetActive(false); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.GetComponentInParent <Controller>()) { Controller player = collision.GetComponentInParent <Controller>(); triggeredPlayers.Add(player); player.isTriggeringCharacterCustomizer = transform; CustomizerController controller = player.GetComponent <CustomizerController>(); controller.customization = this; if (isInUse) { return; } Setup(player); } }