public void Init(TutorialData data) { this.tutorialData = data; this.tutorialStep = this.tutorialData.TutorialStep; this.animatedText.ResultText = this.tutorialData.Message; this.popupPositionRect = this.tutorialData.PopupPositionRect; this.InBattleMode = data.InBattleMode; if (data.StepCountInTutorial <= 1) { this.tutorialProgressLabel.gameObject.SetActive(false); } else { this.tutorialProgressLabel.gameObject.SetActive(true); this.tutorialProgressLabel.text = $"{data.CurrentStepNumber}/{data.StepCountInTutorial}"; } this.continueOnClick = data.ContinueOnClick; this.SetupAdditionalImage(this.tutorialData); this.InitTankHighlighting(this.tutorialData); if (!this.continueOnClick) { this.continueButton.gameObject.SetActive(false); } else { this.continueButton.gameObject.SetActive(true); this.continueButton.interactable = true; TutorialCanvas.Instance.AddAllowSelectable(this.continueButton); } }
private void SetupInteractableButton(TutorialData data) { if (data.InteractableButton != null) { data.InteractableButton.onClick.AddListener(new UnityAction(this.OnInteractableButtonClick)); TutorialCanvas.Instance.AddAllowSelectable(data.InteractableButton); data.InteractableButton.interactable = true; } }
private void InitTankHighlighting(TutorialData data) { if (data.Type == TutorialType.HighlightTankPart) { this.highlightHull = data.HighlightHull; this.highlightWeapon = data.HighlightWeapon; this.cameraOffset = data.CameraOffset; this.outlinePrefab = data.OutlinePrefab; } }
private void SetupAdditionalImage(TutorialData data) { if (string.IsNullOrEmpty(data.ImageUid)) { this.image.gameObject.SetActive(false); } else { this.image.gameObject.SetActive(true); this.image.SpriteUid = data.ImageUid; } }
public void Show(Entity tutorialStep, int currentStepNumber, int stepCountInTutorial) { if (!this.isShow) { this.isShow = true; string message = tutorialStep.GetComponent <TutorialStepDataComponent>().Message; TutorialHighlightTankStepDataComponent component = !tutorialStep.HasComponent <TutorialHighlightTankStepDataComponent>() ? new TutorialHighlightTankStepDataComponent() : tutorialStep.GetComponent <TutorialHighlightTankStepDataComponent>(); TutorialData data = new TutorialData { Type = this.tutorialType, TutorialStep = tutorialStep, Message = message, PopupPositionRect = this.popupPositionRect, ShowDelay = this.showDelay, ImageUid = this.imageUid, InteractableButton = this.selectable, OutlinePrefab = this.outlinePrefab, CameraOffset = this.cameraOffset, HighlightHull = component.HighlightHull, HighlightWeapon = component.HighlightWeapon, CurrentStepNumber = currentStepNumber, StepCountInTutorial = stepCountInTutorial, InBattleMode = this.inBattleMode }; switch (this.tutorialType) { case TutorialType.Default: data.ContinueOnClick = true; this.ShowMaskedPopupStep(data); break; case TutorialType.Interact: this.ShowInteractStep(data); break; case TutorialType.HighlightTankPart: data.ContinueOnClick = true; this.ShowHighlightTankStep(data); break; case TutorialType.CustomHandler: this.stepCustomHandler.RunStep(data); break; default: break; } if (this.tutorialHideTrigger != null) { this.tutorialHideTrigger.Activate(tutorialStep); } } }
public void ShowIntroDialog(TutorialData data, bool canSkipTutorial) { this.tutorialCamera.gameObject.SetActive(true); this.BlockInteractable(); this.CheckForOverlayCamera(); this.overlay.SetActive(true); this.introDialog.Show(data.TutorialStep, canSkipTutorial); base.GetComponent <Animator>().SetBool("show", true); this.overlayCanvas.GetComponent <Animator>().SetBool("show", true); this.isShow = true; this.tutorialScreen.SetActive(true); MainScreenComponent.Instance.ToggleNews(false); }
public void Show(TutorialData data, bool useOverlay, GameObject[] highlightedRects = null, RectTransform arrowPositionRect = null) { this.tutorialCamera.gameObject.SetActive(true); this.CheckForOverlayCamera(); this.dialog.Init(data); this.allowCancelHandler = false; this.overlay.SetActive(useOverlay); this.CreateMasks(highlightedRects); this.BlockInteractable(); if (arrowPositionRect != null) { this.SetArrowPosition(arrowPositionRect); } base.Invoke("DelayedShow", data.ShowDelay); this.tutorialScreen.SetActive(true); }
private void ShowMaskedPopupStep(TutorialData data) { TutorialCanvas.Instance.Show(data, this.useOverlay, this.highlightedRects, this.arrowPositionRect); }
private void ShowHighlightTankStep(TutorialData data) { TutorialCanvas.Instance.Show(data, this.useOverlay, this.highlightedRects, null); }
public void SetupActivePopup(TutorialData data) { this.dialog.OverrideData(data); }
public void OverrideData(TutorialData data) { this.tutorialStep = data.TutorialStep; this.continueOnClick = data.ContinueOnClick; }