private void DrawPoseMenu() { foreach (PoseObject pose in _poseObjects) { PoseButton poseButton = Instantiate(_template, transform); poseButton.SetBackgroundSprite(_inactive); poseButton.SetIconImageSprite(pose.Icon); poseButton.ButtonClicked += OnPoseButtonClick; } }
private void OnPoseButtonClick(PoseButton poseButton) { poseButton.SetBackgroundSprite(_active); if ((++_chosenPosesCount) == 3) { _title.DOAnchorPosX(530, 0.3f).SetEase(Ease.InBack).SetDelay(.5f); _rectTransform.DOAnchorPosY(-760, 0.3f).SetEase(Ease.InBack).SetDelay(.5f).OnComplete(() => { _startJump.Raise(); }); } }