Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 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;
     }
 }
Ejemplo n.º 5
0
        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);
                }
            }
        }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 private void ShowMaskedPopupStep(TutorialData data)
 {
     TutorialCanvas.Instance.Show(data, this.useOverlay, this.highlightedRects, this.arrowPositionRect);
 }
Ejemplo n.º 9
0
 private void ShowHighlightTankStep(TutorialData data)
 {
     TutorialCanvas.Instance.Show(data, this.useOverlay, this.highlightedRects, null);
 }
Ejemplo n.º 10
0
 public void SetupActivePopup(TutorialData data)
 {
     this.dialog.OverrideData(data);
 }
Ejemplo n.º 11
0
 public void OverrideData(TutorialData data)
 {
     this.tutorialStep    = data.TutorialStep;
     this.continueOnClick = data.ContinueOnClick;
 }