private void OnTriggerEnter2D(Collider2D trigger) { if (trigger.tag == PlayerBehaviour.kPlayerTag) { ActionPerformer.Instance.SetAction(_action, gameObject); } if (!_action.IsRequirementSatisfied(gameObject)) { Tutorial.ShowForIDIfNeeded(ETutorialId.LockedDoor); } }
public void SetAction(ActionBase action, GameObject setter = null, Sprite image = null) { if (action != null) { _currentAction = action; _button.enabled = true; _button.image.sprite = image == null? action.ActionImage : image; _button.image.color = Color.white; _currentActionSetter = setter; _button.interactable = action.IsRequirementSatisfied(setter); } else { _button.enabled = false; _button.image.color = new Color(0f, 0f, 0f, 0f); _currentAction = null; _currentActionSetter = null; _button.image.sprite = null; } }