Exemplo n.º 1
0
        public void StartFTUE(OnStartFtue e)
        {
            Events.Instance.RemoveListener <OnStartFtue>(StartFTUE);

            currentStepIndex = startStep;
            currentStep      = steps[startStep];

            ArrowDisplayer.Instances("FtueArrow").SetContainer(transform as RectTransform);
            ArrowDisplayer.Instances("FtueArrow").SetModels(simpleModel, iconModel);

            ArrowDisplayer.Instances("FtueTap").SetContainer(transform as RectTransform);
            ArrowDisplayer.Instances("FtueTap").SetModels(pointTap, null);

            for (int i = 0; i < steps.Count; i++)
            {
                if (steps[i].ftueSprite != null)
                {
                    SetFtueUIImageContainer(steps[i].ftueSprite, false);
                }
                if (steps[i].hiddenUI != null)
                {
                    SetFtueUIImageContainer(steps[i].hiddenUI, false);
                }
                if (steps[i].titleImage != null)
                {
                    SetFtueUIImageContainer(steps[i].titleImage, false);
                }
            }

            if (!gameObject.activeSelf)
            {
                gameObject.SetActive(true);
            }
            RunCurrentStep();
        }
Exemplo n.º 2
0
        public void ValidStep()
        {
            StopAllCoroutines();
            playerFree = false;
            GetComponent <Image>().raycastTarget = true;
            Attach();
            if (_uitargetContainer != null)
            {
                if (currentStep.UItarget != null)
                {
                    currentStep.UItarget.transform.SetParent(_uitargetContainer);
                    currentStep.UItarget.transform.SetSiblingIndex(_childIndex);
                }
                else if (currentStep.playerBtn != null)
                {
                    currentStep.playerBtn.transform.SetParent(_uitargetContainer);
                    currentStep.playerBtn.transform.SetSiblingIndex(_childIndex);
                }
                _uitargetContainer = null;
            }

            if (currentStep.targetTopic != -1)
            {
                NotePad.Instance.Topics[currentStep.targetTopic].gameObject.transform.SetParent(NotePad.Instance.gameObject.transform);
                NotePad.Instance.Topics[currentStep.targetTopic].SetColor(Color.white);
            }

            receiveTouch = false;
            activeInput  = FtueInputs.NONE;
            currentStepIndex++;
            if (currentStepIndex >= steps.Count)
            {
                Clear();
            }
            else
            {
                ftueText.gameObject.SetActive(false);
                ArrowDisplayer.Instances("FtueArrow").CleanArrows();
                ArrowDisplayer.Instances("FtueTap").CleanArrows();
                _clickableTransform = null;

                currentStep = steps[currentStepIndex];
                Events.Instance.Raise(new OnFtueNextStep());
                if (currentStep.targetTopic != -1 && !NotePad.Instance.Open)
                {
                    Events.Instance.AddListener <OnFTUEOpenDialogue>(OpenDialogue);
                }
                else
                {
                    RunCurrentStep();
                }
            }
        }
Exemplo n.º 3
0
        public FtueComponent Copy()
        {
            FtueComponent copy = new FtueComponent();

            copy.text       = text;
            copy.titleImage = titleImage;
            copy.ftueSprite = ftueSprite;
            copy.hiddenUI   = hiddenUI;
            copy.UItarget   = UItarget;
            copy.input      = input;
            copy.forceAlpha = forceAlpha;
            return(copy);
        }
Exemplo n.º 4
0
 public void Clear()
 {
     _finish = true;
     active  = false;
     StopAllCoroutines();
     _clickableTransform = null;
     gameObject.SetActive(false);
     receiveTouch     = false;
     currentStep      = null;
     currentStepIndex = 0;
     activeInput      = FtueInputs.NONE;
     tapSprite.gameObject.SetActive(false);
     pinchSprite.gameObject.SetActive(false);
     ftueText.gameObject.SetActive(false);
     GameManager.Instance.EndOfFTUE();
 }
Exemplo n.º 5
0
 public void ForceClear()
 {
     _finish = true;
     active  = false;
     StopAllCoroutines();
     _clickableTransform = null;
     gameObject.SetActive(false);
     receiveTouch     = false;
     currentStep      = null;
     currentStepIndex = 0;
     activeInput      = FtueInputs.NONE;
     tapSprite.gameObject.SetActive(false);
     pinchSprite.gameObject.SetActive(false);
     ftueText.gameObject.SetActive(false);
     Display(false);
     ActiveHidden();
 }