public void CheckStepFinishAction(string trigAction)
 {
     if ((this.onGoingStep != null) && (this.onGoingStep.finishAction == trigAction))
     {
         this.DestoryShowtingStep();
         this.onGoingStepIndex++;
         if (this.onGoingStepIndex >= this.onGoingTutorial.steps.Length)
         {
             this.onGoingStep = null;
             if (this.nextStartFromId == 10)
             {
                 this.DothingsAfterTutorial();
             }
         }
         else
         {
             MarketingData marketingDatas = GameData.instance.MarketingDatas;
             if (((this.onGoingStep.text == "Tutorial_9_4") && (marketingDatas != null)) && !marketingDatas.NeedShowWikiLink)
             {
                 if (this.nextStartFromId == 10)
                 {
                     this.DothingsAfterTutorial();
                 }
             }
             else
             {
                 this.onGoingStep = this.onGoingTutorial.steps[this.onGoingStepIndex];
                 this.CheckStepAppealAction(string.Empty);
             }
         }
     }
 }
 public void SetStepConfig(TutorialStep step)
 {
     this.stepConfig = step;
     if (string.IsNullOrEmpty(step.maskId))
     {
         if (step.onlyText == 1)
         {
             this.fullBg.gameObject.SetActive(false);
         }
         else
         {
             this.fullBg.gameObject.SetActive(true);
         }
         if (!string.IsNullOrEmpty(step.text))
         {
             string str = Localization.Localize(step.text);
             this.fullTextObj.SetActive(true);
             this.textMesh.text = str;
             this.textMesh.Commit();
         }
         if (step.fullScreenPos != 0)
         {
             this.fullTextObj.transform.localPosition = this.positions[step.fullScreenPos - 1].localPosition;
         }
     }
     else
     {
         GameObject gizmoPrefab = Resources.Load("tutorialMask/" + step.maskId) as GameObject;
         GameObject obj3 = GameObjectUtil.InstantiateItemAsChildOf(gizmoPrefab, base.gameObject);
         this.fullBg.gameObject.SetActive(false);
         if (step.isExtra)
         {
             if (!string.IsNullOrEmpty(step.text))
             {
                 string text = Localization.Localize(step.text);
                 obj3.GetComponentInChildren<TutorialStepPosition>().setText(text, this.textMesh);
             }
             this.fullTextObj.SetActive(false);
             this.fullBg.gameObject.SetActive(true);
         }
         else
         {
             if (!string.IsNullOrEmpty(step.text))
             {
                 string str3 = Localization.Localize(step.text);
                 TutorialStepPosition position2 = obj3.GetComponentInChildren<TutorialStepPosition>();
                 position2.setText(str3, this.textMesh);
                 position2.SetBgColor(this.textBg.color);
             }
             SpriteRenderer componentInChildren = obj3.GetComponentInChildren<SpriteRenderer>();
             if ((componentInChildren != null) && (this.fullBg != null))
             {
                 componentInChildren.color = this.fullBg.color;
             }
         }
     }
 }
示例#3
0
    public void EnterStep(TutorialStep WhichStep)
    {
        // CurrentSetp change parent to this
        WhichStep.transform.parent = this.transform;
        WhichStep.transform.localPosition = Vector3.zero;
        CurrentSetp = WhichStep;
        if(CurrentCoroutine != null)
        {
            StopCoroutine(CurrentCoroutine);
           // print("StopCoroutine when CurrentCoroutine != null");
        }

        // Get step tye
        WaitForInputLeft = CurrentSetp.gameObject.name == Config.TTRTurnLeft;
        WaitForInputRight = CurrentSetp.gameObject.name == Config.TTRTurnRight;
        WaitForInputJump = CurrentSetp.gameObject.name == Config.TTRJump;

        // Stop player moving
        PlayerConroller.Instance.SelfMover.ResetSpeed(0);
        //print("ResetSpeed(0) in EnterStep:" + CurrentSetp.gameObject.name);

        // Ugly here, check input lock
        PlayerConroller.Instance.LockInput(true);
        if (WaitForInputLeft)
        {
            PlayerConroller.Instance.UnlockInputLeft();
        }
        else if (WaitForInputRight)
        {
            PlayerConroller.Instance.UnlockInputRight();
        }
        else if (WaitForInputJump)
        {
            PlayerConroller.Instance.UnlockInputJump();
        }

        // Wait for Force Complete Curren tStep
        CurrentCoroutine = StartCoroutine(ForceCompleteCurrentStep());

        // Final we open tutorial after logic above
        InTutorial = true;
    }
示例#4
0
    protected override void Awake()
    {
        //Drag INPUT into SolutionWindow
        TutorialStep step1 = new TutorialStep();

        AddStep(step1);
        step1.Description =
            "Try out those fancy new instructions you *bzzrt* got!  " +
            "\nTo write a command, drag an INPUT instruction into the SOLUTION WINDOW.";

        step1.AddBeginBehavior(
            () => {
            var controller = FindObjectOfType <UIController>();
            FocusInstruction(OpCode.INPUT);
            controller.FocusUIElement("SolutionWindow");
        }
            );

        step1.AddCompletionCondition(
            () => {
            GameObject solutionWindow = GameObject.FindGameObjectWithTag("SolutionWindow");
            int numInPlay             = solutionWindow.GetComponent <InstructionContainer>().Count;

            var instructionCache = GameObject.FindGameObjectWithTag("InstructionCacheContent");
            instructionCache.GetComponentInChildren <UIControl>().Focus();
            return((numInPlay > 0) && DragNDrop.CurrDragInstruction == null);
        }
            );

        TutorialStep step2 = new TutorialStep();

        step2.Description =
            "Press the play button to run your solution whenever you'd like." +
            "\n\nTry it now to see what happens *bzzrt* when you do something wrong!";

        step2.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("PlayButton");
        }
            );

        step2.AddCompletionCondition(
            () => {
            return(FindObjectOfType <Interpreter>().Running);
        }
            );

        AddStep(step2);

        TutorialStep step3 = new TutorialStep();

        AddStep(step3);
        step3.AddBeginBehavior(
            () => {
            FindObjectOfType <TutorialTextBoxController>().Deactivate();
        }
            );

        step3.AddCompletionCondition(
            () => {
            return(FindObjectOfType <InputBox>().Count < 1);
        }
            );

        step3.AddEndBehavior(
            () => {
            FindObjectOfType <TutorialTextBoxController>().Activate();
        }
            );
        step3.EndDelay = 1.0f;


        TutorialStep step4 = new TutorialStep();

        AddStep(step4);
        step4.Description = "When Computron runs out *bzzrt* of instructions, your output is analyzed." +
                            "\n\nNow if you're ready to get to work, hit the halt button to stop the simulation and try again!";

        step4.AddBeginBehavior(
            () => {
            var controller = FindObjectOfType <UIController>();
            controller.FocusUIElement("SolutionWindow");
            controller.FocusUIElement("HaltButton");
            TextBoxController.transform.position += new Vector3(5, 0);
        }
            );

        step4.AddCompletionCondition(
            () => {
            return(!FindObjectOfType <Interpreter>().Running);
        }
            );

        step4.AddEndBehavior(
            () => {
            TextBoxController.transform.position -= new Vector3(5, 0);
        }
            );
    }
示例#5
0
    protected override void Awake()
    {
        var step1 = new TutorialStep();

        AddStep(step1);
        step1.Description = "You-you-you got Memory Cards! Computrons are very forgetful, so memory cards allow them " +
                            "to remember more than one number at a time." +
                            "\n\n Drag both of the cards to the panel below to put them in play!";
        step1.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("RegisterHandSlot");
            uiController.HighlightUIElement("RegisterHandSlot");
            uiController.FocusUIElement("CardPlayArea");
            uiController.HighlightUIElement("CardPlayArea");
        }
            );

        step1.AddCompletionCondition(
            () => {
            return(FindObjectOfType <PlayedCardContainer>().Count > 1);
        }
            );

        var step2 = new TutorialStep();

        AddStep(step2);
        step2.Description = "To make use of those *bbbzrt* cards, you need to use the right instruction!" +
                            "\n\nDrag a MOVE_TO instruction into the solution window.";
        step2.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("SolutionWindow");
            FocusInstruction(OpCode.MOVE_TO);
        }
            );
        step2.AddCompletionCondition(
            () => {
            var container = FindObjectOfType <InstructionContainer>();
            int numInPlay = container.Count;
            FocusInstruction(OpCode.MOVE_TO);
            return((numInPlay > 0) && DragNDrop.CurrDragInstruction == null);
        }
            );

        var step3 = new TutorialStep();

        AddStep(step3);
        step3.Description = "Whenev-ev-ev-ever you play a card-based instruction, you must link it to a card that you played." +
                            "\n\nClick on one of the cards you played to link your instruction to it!";

        step3.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("CardPlayArea");
            var cards = FindObjectOfType <PlayedCardContainer>().GetCards();
            foreach (var card in cards)
            {
                card.GetComponent <UIControl>().Disable();
            }
        }
            );
        step3.AddCompletionCondition(
            () => {
            return(FindObjectOfType <CardInstructionLinker>() == null);
        }
            );
        step3.AddEndBehavior(
            () => {
            var cards = FindObjectOfType <PlayedCardContainer>().GetCards();
            foreach (var card in cards)
            {
                card.GetComponent <UIControl>().Enable();
            }
        }
            );

        var step4 = new TutorialStep();

        AddStep(step4);
        step4.Description = "If you ever make an ***ERROR***, you can always click on a card instruction's argument " +
                            "to relink that instruction." +
                            "\n\n Give it a try!";

        GameObject           boundCard        = null;
        CardCommandDragNDrop boundInstruction = null;

        step4.AddBeginBehavior(
            () => {
            var container      = FindObjectOfType <InstructionContainer>().contentPanel;
            var commands       = container.GetComponentsInChildren <Command>();
            boundInstruction   = commands[0].GetComponent <CardCommandDragNDrop>();
            var label          = boundInstruction.ArgLabel;
            var labelUIControl = label.GetComponent <UIControl>();
            labelUIControl.Enable();
            uiController.FocusUIElement(labelUIControl);
            labelUIControl.StartHighlight();
        }
            );
        step4.AddCompletionCondition(() => { return(FindObjectOfType <CardInstructionLinker>() != null); });
        step4.AddEndBehavior(
            () => {
            boundCard = boundInstruction.BoundCard;
        }
            );

        var step5 = new TutorialStep();

        AddStep(step5);
        step5.Description = "Select another card to relink the MOVE_TO instruction";

        step5.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("CardPlayArea");
            uiController.FocusUIElement("RegisterHandSlot");
        }
            );
        step5.AddCompletionCondition(
            () => {
            return(FindObjectOfType <CardInstructionLinker>() == null);
        }
            );
        step5.AddEndBehavior(
            () => {
            var cards = FindObjectOfType <PlayedCardContainer>().GetCards();
            foreach (var card in cards)
            {
                card.GetComponent <UIControl>().Enable();
            }
        }
            );

        var step6 = new TutorialStep();

        AddStep(step6);
        step6.Description = "Now that you have your act together, let's see that memory card in action. " +
                            "\n\nPlay an INPUT instruction, and place it above the MOVE_TO";
        step6.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("SolutionWindow");
            DisableInstructionInSolutionWindow(0);
        }
            );

        step6.AddCompletionCondition(
            () => {
            FocusInstruction(OpCode.INPUT);
            var container = FindObjectOfType <InstructionContainer>().contentPanel;
            var commands  = container.GetComponentsInChildren <Command>();
            return(commands[0].Instruction == OpCode.INPUT && DragNDrop.CurrDragInstruction == null);
        }
            );

        TutorialStep step7 = new TutorialStep();

        AddStep(step7);
        step7.Description = "Hit play, and watch *bzzzrt* the magic happen.";

        step7.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("PlayButton");
        }
            );

        step7.AddCompletionCondition(
            () => {
            return(FindObjectOfType <Interpreter>().Running);
        }
            );
    }
    private void OnQuery_SELECT_RUSH()
    {
        int  index = (int)GameSection.GetEventData();
        bool flag  = MonoBehaviourSingleton <DeliveryManager> .I.IsCompletableDelivery(visibleDeliveryList[index].dId);

        int delivery_id = visibleDeliveryList[index].dId;

        if (flag)
        {
            DeliveryTable.DeliveryData table = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)visibleDeliveryList[index].dId);

            changeToDeliveryClearEvent = true;
            bool is_tutorial        = !TutorialStep.HasFirstDeliveryCompleted();
            bool enable_clear_event = table.clearEventID != 0;
            GameSection.StayEvent();
            MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
            MonoBehaviourSingleton <DeliveryManager> .I.SendDeliveryComplete(visibleDeliveryList[index].uId, enable_clear_event, delegate(bool is_success, DeliveryRewardList recv_reward)
            {
                if (is_success)
                {
                    if (is_tutorial)
                    {
                        TutorialStep.isSendFirstRewardComplete = true;
                    }
                    if (!enable_clear_event)
                    {
                        MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
                        GameSection.ChangeStayEvent("RUSH_REWARD", new object[2]
                        {
                            delivery_id,
                            recv_reward
                        });
                    }
                    else
                    {
                        GameSection.ChangeStayEvent("CLEAR_EVENT", new object[3]
                        {
                            (int)table.clearEventID,
                            delivery_id,
                            recv_reward
                        });
                    }
                }
                else
                {
                    changeToDeliveryClearEvent = false;
                }
                GameSection.ResumeEvent(is_success, null);
            });
        }
        else
        {
            DeliveryTable.DeliveryData deliveryTableData = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)delivery_id);

            if (deliveryTableData.GetConditionType(0u) == DELIVERY_CONDITION_TYPE.COMPLETE_DELIVERY_ID)
            {
                GameSection.SetEventData(new object[2]
                {
                    delivery_id,
                    null
                });
            }
            else
            {
                ArenaTable.ArenaData arenaData = deliveryTableData.GetArenaData();
                MonoBehaviourSingleton <QuestManager> .I.SetCurrentQuestID((uint)arenaData.questIds[0], true);

                MonoBehaviourSingleton <QuestManager> .I.SetCurrentArenaId(arenaData.id);

                GameSection.ChangeEvent("TO_ROOM", deliveryTableData);
            }
        }
    }
 public void SetTutorialStepCompleted(TutorialStep step)
 {
     tutorialStepsCompleted[step] = true;
 }
示例#8
0
    public void ShowTutorialMessage(TutorialStep step)
    {
        TutorialCharacter.gameObject.SetActive(step.hasCharacter && !step.hasCharacter2);
        TutorialCharacter2.gameObject.SetActive(step.hasCharacter2);

        TutorialPointerImage.gameObject.SetActive(step.hasPointer);
        if (step.hasPointer)
        {
            if (step.targetFocus != null)
            {
                TutorialPointerImage.transform.position = new Vector3(step.targetFocus.position.x + step.pointerPosition.x, step.targetFocus.position.y + step.pointerPosition.y);
            }
            else
            {
                TutorialPointerImage.transform.localPosition = new Vector3(step.pointerPosition.x, step.pointerPosition.y);
            }
//			TutorialPointerImage.transform.localPosition = new Vector3 (step.pointerPosition.x, step.pointerPosition.y, 0);
//			TutorialPointerImage.transform.position = new Vector3(step.targetFocus.position.x + step.pointerPosition.x, step.targetFocus.position.y + step.pointerPosition.y);
            GUIEffect pointerEffect = TutorialPointerImage.GetComponent <GUIEffect> ();
            pointerEffect.ResetData();
            pointerEffect.startPos = TutorialPointerImage.transform.localPosition;
            TutorialPointerImage.transform.localRotation = Quaternion.identity;

            switch (step.pointerRot)
            {
            case TutorialStep.PointerRotation.Up:
                pointerEffect.effectType = GUIEffect.EffectType.SwingVertical;
                break;

            case TutorialStep.PointerRotation.Right:
                TutorialPointerImage.transform.Rotate(0, 0, -90);
                pointerEffect.effectType = GUIEffect.EffectType.SwingHorizontal;
                break;

            case TutorialStep.PointerRotation.Down:
                TutorialPointerImage.transform.Rotate(0, 0, 180);
                pointerEffect.effectType = GUIEffect.EffectType.SwingVertical;
                break;

            case TutorialStep.PointerRotation.Left:
                TutorialPointerImage.transform.Rotate(0, 0, 90);
                pointerEffect.effectType = GUIEffect.EffectType.SwingHorizontal;
                break;
            }
        }

        TutorialTextPanel.SetActive(true);
        if (step.descriprion_id == 0 && step.tap_id == 0)
        {
            TutorialTextPanel.SetActive(false);
        }
        else
        {
            TutorialDescriptionMessage.text = Localization.Instance.GetLocale(step.descriprion_id);
            TutorialTapMessage.text         = Localization.Instance.GetLocale(step.tap_id);
        }

        switch (step.textPos)
        {
        case TutorialStep.TextPosition.Bottom:
            TutorialTextPanel.transform.localPosition = new Vector3(96, -440, 0);
            break;

        case TutorialStep.TextPosition.Center:
            TutorialTextPanel.transform.localPosition = new Vector3(0, 0, 0);
            break;

        case TutorialStep.TextPosition.Top:
            TutorialTextPanel.transform.localPosition = new Vector3(0, 450, 0);
            break;

        case TutorialStep.TextPosition.Flip:
            TutorialTextPanel.transform.localPosition = new Vector3(-88f, 38f, 0);
            Vector3 flipVector = new Vector3(-1f, 1f, 1f);
            TutorialTextPanel.transform.localScale          = flipVector;
            TutorialDescriptionMessage.transform.localScale = flipVector;
            TutorialTapMessage.transform.localScale         = flipVector;
            break;
        }

        if (ScreenManager.Instance.current != null && ScreenManager.Instance.current.name == "FindToolScreen(Clone)")
        {
            ScreenManager.Instance.current.SetActive(false);
        }

        switch (step.panel)
        {
        case TutorialStep.enumPanel.Action:
            AddClickObject(PanelManager.Instance.ActionPanel.GetAction(step.target.name).gameObject).GetComponent <ActionController>().action = step.target.GetComponent <Action>();
            break;

        case TutorialStep.enumPanel.Event:
            AddClickObject(PanelManager.Instance.EventPanel.EventActionPanel.GetAction(step.target.name).gameObject);
            break;

        case TutorialStep.enumPanel.OpenQuest:
            QuestManager.Instance.GenerateTutorialQuest();
            QuestManager.Instance.CreateQuest();
            PanelManager.Instance.questLogCountText.text = PanelManager.Instance.QuestPanel.questLog.Count.ToString();
            AddClickObject(PanelManager.Instance.QuestLogButton.gameObject);
            break;

        case TutorialStep.enumPanel.QuestHint:
            AddClickObject(PanelManager.Instance.QuestPanel.GetQuest(step.target.name).gameObject).AddComponent <OnClickDelegatController>().onClick += () => {
                blocker = true;
                ScreenManager.Instance.current.GetComponent <ScreenBase>().onDestroy += () => { PanelManager.Instance.CloseButton(); StartCoroutine(TimedCoroutine(0.5f)); };
            };
            break;

        case TutorialStep.enumPanel.CloseQuest:
            step.target.GetComponent <Action>().Perform_Action();
            break;

        case TutorialStep.enumPanel.Timed:
            blocker = true;
            StartCoroutine(TimedCoroutine(step.time));
            break;

        case TutorialStep.enumPanel.Screen:
            blocker = true;
            ScreenManager.Instance.current.GetComponent <ScreenBase>().onDestroy += () => {
                StartCoroutine(TimedCoroutine(0.1f));
            };
            ScreenManager.Instance.current.SetActive(true);
            break;

        case TutorialStep.enumPanel.Story:
            GameObject go = PanelManager.Instance.ActionPanel.GetAction(step.target.name).gameObject;
            AddClickObject(go);
            if (go.name[go.name.Length - 1] == '9')
            {
                step.targetFocus.transform.localPosition     = new Vector2(step.targetFocus.transform.localPosition.x, step.targetFocus.transform.localPosition.y + 56f);
                TutorialPointerImage.transform.localPosition = new Vector3(TutorialPointerImage.transform.localPosition.x, TutorialPointerImage.transform.localPosition.y + 56f);
            }
            break;
        }

        SendMessage("OnShowTutorialMessage", step);
    }
示例#9
0
 void OnCompleteTutorialStep(TutorialStep currentStep)
 {
     if (HelpManager.Instance.CurrentStep == TutorialStep.PlaceTreat)
     {
     }
 }
示例#10
0
        public Dictionary <int, TutorialStep> ReadTutorialSteps(string path)
        {
            var     result  = new Dictionary <int, TutorialStep>();
            NavNode navNode = null;
            Check   check   = null;
            string  text    = null;

            using (var reader = XmlReader.Create(new StreamReader(path)))
            {
                while (reader.ReadToFollowing("step"))
                {
                    var li            = Convert.ToInt32(reader.GetAttribute("li"));
                    var nextStep      = reader.GetAttribute("nextStep");
                    var strikeOnDone  = Convert.ToBoolean(reader.GetAttribute("strikeOnDone"));
                    var subTreeReader = reader.ReadSubtree();

                    while (subTreeReader.Read())
                    {
                        switch (subTreeReader.Name)
                        {
                        case "navigate":
                            var projectName          = reader.GetAttribute("project");
                            var file                 = reader.GetAttribute("file");
                            var typeName             = reader.GetAttribute("type");
                            var methodName           = reader.GetAttribute("method");
                            var methodNameOccurrence = Convert.ToInt32(reader.GetAttribute("methodOccurrence"));
                            var textToFind           = reader.GetAttribute("textToFind");
                            var textToFindOccurrence = Convert.ToInt32(reader.GetAttribute("textToFindOccurrence"));
                            var runMethod            = reader.GetAttribute("runMethod");
                            navNode = new NavNode(projectName, file, typeName, methodName, methodNameOccurrence,
                                                  textToFind,
                                                  textToFindOccurrence, runMethod);
                            break;

                        case "check":
                            var      action  = reader.GetAttribute("action");
                            var      method  = reader.GetAttribute("method");
                            string[] actions = null;

                            if (action != null || method != null)
                            {
                                if (action != null)
                                {
                                    actions = Regex.Split(action, ";");
                                }

                                check = new Check(actions, method);
                            }
                            break;

                        case "text":
                            text = reader.ReadInnerXml();
                            text = Regex.Replace(text, @"\s+", " ");
                            text = _actionToShortcutConverter.SubstituteShortcutsViaVs(text);
                            text = ConvertImagePaths(text);
                            break;
                        }
                    }

                    var step = new TutorialStep(li, navNode, check, text, nextStep, strikeOnDone);
                    result.Add(li, step);
                    navNode = null;
                    check   = null;
                }
            }
            return(result);
        }
示例#11
0
    protected override void Awake()
    {
        TutorialStep step1 = new TutorialStep();

        AddStep(step1);
        step1.Description = "Computron doesn't have legs, but it can still jump! " +
                            "\nDrag a jump instruction into the solution window.";

        step1.AddBeginBehavior(
            () => {
            var controller = FindObjectOfType <UIController>();
            controller.FocusUIElement("JUMP");
            controller.FocusUIElement("SolutionWindow");
        }
            );

        step1.AddCompletionCondition(
            () => {
            var container = FindObjectOfType <InstructionContainer>();
            int numInPlay = container.Count;
            FocusInstruction(OpCode.JUMP);
            return((numInPlay > 0) && DragNDrop.CurrDragInstruction == null);
        }
            );

        TutorialStep step2 = new TutorialStep();

        step2.Description = "Fantas-tas-tas- *bzzrt* tastic. Let's break Computron and make an infinite loop!" +
                            "\n\n Drag the jump anchor to be above the jump instruction!";

        AddStep(step2);

        step2.AddBeginBehavior(
            () => {
            DisableInstructionInSolutionWindow(0);
            uiController.FocusUIElement("SolutionWindow");
        }
            );

        step2.AddCompletionCondition(
            () => {
            var container = FindObjectOfType <InstructionContainer>().contentPanel;
            var commands  = container.GetComponentsInChildren <Command>();

            return(commands.Length > 0 &&
                   commands[0].Instruction == OpCode.NO_OP &&
                   DragNDrop.CurrDragInstruction == null);
        }
            );

        TutorialStep step3 = new TutorialStep();

        AddStep(step3);
        step3.Description = "Now, place an INPUT instruction between the JUMP instruction, and the unlabeled jump anchor. ";

        step3.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("SolutionWindow");
            DisableInstructionInSolutionWindow(0);
            DisableInstructionInSolutionWindow(1);
        }
            );

        step3.AddCompletionCondition(
            () => {
            FocusInstruction(OpCode.INPUT);
            var container = FindObjectOfType <InstructionContainer>().contentPanel;
            var commands  = container.GetComponentsInChildren <Command>();
            return(commands.Length > 2 &&
                   commands[0].Instruction == OpCode.NO_OP &&
                   commands[1].Instruction == OpCode.INPUT &&
                   commands[2].Instruction == OpCode.JUMP &&
                   DragNDrop.CurrDragInstruction == null);
        }
            );

        TutorialStep step4 = new TutorialStep();

        AddStep(step4);
        step4.Description = "Hit play, and notice how-how-how *bzzrt* the game will never end.";

        step4.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("PlayButton");
        }
            );

        step4.AddCompletionCondition(
            () => {
            return(FindObjectOfType <Interpreter>().Running);
        }
            );

        TutorialStep step5 = new TutorialStep();

        AddStep(step5);
        step5.Description = "When you get dizzy, hit HALT";
        step5.AddBeginBehavior(
            () => {
            uiController.ClearFocus();
            uiController.HighlightUIElement("HaltButton");
            TextBoxController.gameObject.transform.position += new Vector3(5, 0);
        }
            );
        step5.AddCompletionCondition(
            () => {
            return(!FindObjectOfType <Interpreter>().Running);
        }
            );
        step5.AddEndBehavior(
            () => {
            TextBoxController.gameObject.transform.position += new Vector3(-5, 0);
        }
            );

        TutorialStep step6 = new TutorialStep();

        AddStep(step6);
        step6.Description = "Now, let's tell Computron how to break the loop." +
                            "\n\nDrag a JUMP IF NULL instruction into the solution window, and place it in between the INPUT and JUMP instructions.";
        //step6.EndDelay = 0.25f;
        step6.AddBeginBehavior(
            () => {
            FocusInstruction(OpCode.JUMP_IF_NULL);
            uiController.FocusUIElement("SolutionWindow");
            DisableInstructionInSolutionWindow(0);
            DisableInstructionInSolutionWindow(1);
            DisableInstructionInSolutionWindow(2);
        }
            );

        step6.AddCompletionCondition(
            () => {
            var container = FindObjectOfType <InstructionContainer>().contentPanel;
            var commands  = container.GetComponentsInChildren <Command>();

            bool inputSeen = false;
            if (DragNDrop.CurrDragInstruction != null)
            {
                return(false);
            }

            for (int i = 0; i < commands.Length; i++)
            {
                if (commands[i].Instruction == OpCode.INPUT)
                {
                    inputSeen = true;
                    continue;
                }

                if (commands[i].Instruction == OpCode.JUMP_IF_NULL)
                {
                    if (!inputSeen)
                    {
                        return(false);
                    }
                    else if (i + 1 < commands.Length && commands[i + 1].Instruction == OpCode.JUMP)
                    {
                        return(true);
                    }
                    else if (i + 2 < commands.Length && commands[i + 2].Instruction == OpCode.JUMP)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            return(false);
        }
            );

        TutorialStep step7 = new TutorialStep();

        AddStep(step7);
        step7.Description = "Now, take the jump anchor tied to the JUMP IF NULL instruction, " +
                            "and drag it below the JUMP instruction";
        step7.AddBeginBehavior(
            () => {
            var container = FindObjectOfType <InstructionContainer>().contentPanel;
            var commands  = container.GetComponentsInChildren <Command>();
            uiController.FocusUIElement("SolutionWindow");
            DisableAllInInstructionInSolutionWindow();
            foreach (var command in commands)
            {
                if (command.Instruction == OpCode.JUMP_IF_NULL)
                {
                    var dndBehavior = command.GetComponent <JumpDragNDropBehavior>();
                    var anchor      = dndBehavior.childAnchor;
                    var uiControl   = anchor.GetComponent <UIControl>();
                    uiControl.Enable();
                    break;
                }
            }
        }
            );

        step7.AddCompletionCondition(
            () => {
            var container = FindObjectOfType <InstructionContainer>().contentPanel;
            var commands  = container.GetComponentsInChildren <Command>();
            return(commands[commands.Length - 1].Instruction == OpCode.NO_OP &&
                   DragNDrop.CurrDragInstruction == null);
        }
            );

        TutorialStep step8 = new TutorialStep();

        AddStep(step8);
        step8.Description = "Now hit p-p-p-p-play, and observe how computron breaks out of that infinite loop!";

        step8.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("PlayButton");
        }
            );

        step8.AddCompletionCondition(() => { return(FindObjectOfType <Interpreter>().Running); });

        TutorialStep step9 = new TutorialStep();

        AddStep(step9);
        step9.AddBeginBehavior(
            () => {
            TextBoxController.Deactivate();
            uiController.GetControllableUIElement("HaltButton").Disable();
        }
            );

        step9.AddCompletionCondition(
            () => {
            return(FindObjectOfType <Interpreter>().Halted);
        }
            );

        step9.AddEndBehavior(
            () => {
            uiController.GetControllableUIElement("HaltButton").Enable();
        }
            );

        TutorialStep step10 = new TutorialStep();

        AddStep(step10);
        step10.Description = "Whenever you're ready, hit *bzzzrt* HALT and solve the rest of the puzzle!";
        step10.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("HaltButton");
            uiController.HighlightUIElement("HaltButton");
        }
            );

        step10.AddCompletionCondition(
            () => {
            return(!FindObjectOfType <Interpreter>().Running);
        }
            );
    }
示例#12
0
        private void ProcessSteps()
        {
            switch (_state)
            {
            case TutorialStep.Initial:
                // After the game restart, the welcome screen will not display until the second frame
                _state = TutorialStep.Welcome;
                return;

            case TutorialStep.Disabled:
                _text = null;
                return;

            case TutorialStep.Welcome:
                _text =
                    "Vitajte v hre XposeCraft. Tento návod vám postupne ukáže základy hry.\n" +
                    "\n" +
                    "Prvou úlohou je otvorenie vášho editora, či už to je Visual Studio, Jetbrains " +
                    "Rider, alebo obyčajný textový editor. V ňom otvorte projekt a cez ten triedu " +
                    "EconomyTest, nachádzajúcu sa v adresári na ceste <b>Assets/BotScripts</b>.\n" +
                    "\n" +
                    "Následne do existujúcej metódy napíšte:\n" +
                    "<b>XposeCraft.Game.BotRunner.Tutorial = true;</b>\n" +
                    "a uložte zmeny. Potom sa vrátte naspäť a počkajte na zostavenie projektu " +
                    "(ikona sa v Unity roztočí vpravo dole), alebo hru reštartujte tlačidlom hrať.\n" +
                    "\n" +
                    "Ak chcete návod vypnúť, nastavte naopak hodnotu na false.\n" +
                    "Všetko, k čomu máte prístup, je v mennom priestore <b>XposeCraft.Game</b>.";
                return;

            case TutorialStep.FindingWorker:
                _text =
                    "Druhou úlohou je nájdenie vašej základnej budovy a pracovníkov " +
                    "(ktorých zatiaľ dokážete ovládať iba myšou) prostredníctvom kódu.\n" +
                    "\n" +
                    "K nájdeniu aktérov sa používajú pomocné triedy, nazývané s príponou Helper. " +
                    "Nájdite všetky budovy alebo jednotky použitím statickej metódy " +
                    "jednej z týchto tried, ktoré vracajú polia alebo listy. Počet prvkov je " +
                    "následne možné zistiť pomocou vlastnosti <b>.Length</b> alebo <b>.Count</b>.\n" +
                    "\n" +
                    "Všimnete si, že je potrebný generický typ metódy! Volanie teda vyzerá ako " +
                    "<b>GetMyUnits<IUnit>()</b>, kde IUnit hovorí, ktorý typ hľadáte.\n" +
                    "\n" +
                    "Ak nenájdete menný priestor týchto tried, sú pod <b>XposeCraft.Game.Helpers</b>.";
                break;

            case TutorialStep.Gathering:
                _text =
                    "Už viete nájsť aj vaše jednotky, aj budovy. Úlohou je poslať pracovníkov " +
                    "ťažiť suroviny. Trieda pracovníka sa nazýva <b>Worker</b>, k jeho metóde sa teda " +
                    "nedostanete, kým jednotku správne nepretypujete. " +
                    "Premennú tak môžete uložiť použitím výrazu <b>var worker = unit as Worker</b>;\n" +
                    "\n" +
                    "Musíte ale nájsť vhodnú <b>Helper</b> triedu aj na nájdenie surovín. V dokumentácii " +
                    "nájdete správnych viacero možností.\n" +
                    "\n" +
                    "K obsahu listov sa v jazyku C# pristupuje pomocou indexu, teda list[0] je " +
                    "prvý prvok premennej s názvom list.";
                break;

            case TutorialStep.Events:
                _text =
                    "Super, už dokážete zvyšovať množstvo vašich surovín. Teraz môžete začať produkovať " +
                    "nových pracovníkov pre ich rýchlejšie zbieranie.\n" +
                    "\n" +
                    "Hneď po spustení hry ale ešte nemáte dosť surovín. Je preto dôležité najprv pochopiť, " +
                    "ako v hre fungujú <b>udalosti</b>. Pomocou statickej metódy\n" +
                    "<b>XposeCraft.Game.GameEvent.Register</b>\n" +
                    "si vyskúšajte zaregistrovať vhodnú udalosť. Jej typ nájdete v enumeračnom type " +
                    "<b>XposeCraft.Game.Enums.EventType</b>, pomocou ktorého si vyberiete " +
                    "<b>MineralsChanged</b>. Už zostáva iba vytvorenie anonymnej funkcie. V jazyku C# ju " +
                    "môžete zapísať nasledovne: <b>(args) => {\n}</b>";
                break;

            case TutorialStep.Production:
                _text =
                    "Udalosť zaregistrovanú máte, takže do nej teraz vytvorte podmienku použitím " +
                    "vstupnej premennej, ktorú ste mohli nazvať napríklad args. Keď máte 50 minerálov, " +
                    "vo vašej základnej budove <b>BaseCenter</b> za ne môžete produkovať jednotky.\n" +
                    "\n" +
                    "Vytvorte niekoľko nových pracovníkov. Pomôže vám k tomu enumeračný typ <b>UnitType</b>. " +
                    "Udalosť môžete nálsedne skúsiť odregistrovať. Nedostanete sa k nej pomocou slovíčka " +
                    "this, ale musíte pohľadať, čo vám poskytuje typ vstupnej premennej <b>Arguments</b>.\n" +
                    "\n" +
                    "Produkcia prebieha asynchrónne, takže nová jednotka nevznikne hneď. Preto budete " +
                    "musieť použiť ďalšiu udalosť typu <b>UnitProduced</b>, ak sa k nej chcete dostať.";
                break;

            case TutorialStep.Building:
                _text =
                    "Ďalšiou fázou je stavba nových budov. Budova typu <b>NubianArmory</b> dokáže produkovať " +
                    "nové jednotky schopné útočiť na diaľku. Táto budova už stojí 100 minerálov.\n" +
                    "\n" +
                    "Pre lepšiu prehladnosť kódu tentokrát odporúčam písať do triedy BuildingTest.cs, " +
                    "ktorá má metódu BuildingStage. Spúšťa ju vaša akcia startNextStage(). " +
                    "Pripomínam, že budovy dokážu stavať iba pracovníci, ktorí sú typu <b>Worker</b>. " +
                    "Vhodné pozície na stavbu budov nájdete v triede <b>PlaceType</b>, alebo aj cez Helper.\n" +
                    "\n" +
                    "Vytvorte aspoň jednu takúto budovu. Predchádzajúcu udalosť asi budete musieť upraviť, " +
                    "aby vám všetky minerály nebrala produkcia pracovníkov. Viacej pracovníkov ju stavia " +
                    "rýchlejšie, ak použijú metódu FinishBuilding.";
                break;

            case TutorialStep.HotSwap:
                _text =
                    "Pomaly sa blížite ku koncu návodu. Vedlajšou vlastnosťou hry, ktorú pochopíte, je " +
                    "<b>výmena kódu za behu hry</b>. Využívali ste ju zatiaľ celú dobu, keď ste uložili " +
                    "zmeny pred návratom do Unity, ale môže byť vhodné aj vypnúť ju, nech hra pokračuje " +
                    "bez viacnásobného spúšťania vášho kódu. Bez nej budete hru reštartovať obyčajne v Unity.\n" +
                    "\n" +
                    "Vypnúť (alebo cez true zapnúť) ju môžete cez:\n" +
                    "<b>XposeCraft.Game.BotRunner.HotSwap = false</b>";
                break;

            case TutorialStep.ActionQueue:
                _text =
                    "Poslednou možnosťou, ktorú si ukážeme, je <b>fronta akcií</b>. Všetky jednotky " +
                    "majú frontu, ktorá vykonáva akcie v poradí, v akom ste ich pridali. " +
                    "Použitím metód ako Worker.SendGather alebo Unit.Attack sa celá fronta nahradí " +
                    "novou o veľkosti jednej akcie. Vlastnosť jednotiek <b>ActionQueue</b> môžete využiť " +
                    "aj priamo, vytvorením novej fronty ako <b>new UnitActionQueue()</b>.\n" +
                    "\n" +
                    "Do fronty pridávate akcie metódou <b>After</b>, ktorá frontu vracia naspäť. Môžete teda " +
                    "zapísať aj .After(akcia).After(akcia).After(akcia). Vytvorte frontu o dĺžke aspoň 2.\n" +
                    "\n" +
                    "Všetky dostupné akcie vytvárate pomocou konštruktora kľúčovým slovo <b>new</b> " +
                    "a nachádzajú sa v mennom priestore <b>XposeCraft.Game.Control.GameActions</b>.";
                break;

            default:
                _text =
                    "Gratulujem, dokončili ste celý návod! Teraz môžete začať s vývojom vlastného robota, " +
                    "určeného na súboj proti ďalším hráčom v Aréne. Hľadajte nové stratégie a staňte sa " +
                    "najlepším hráčom. Veľa štastia! Zdrojový kód hry je voľne dostupný, takže sa môžete " +
                    "zapojiť aj do rozvíjania samotnej hry.\n" +
                    "\n" +
                    "Nezabudnite si vypnúť tento návod pomocou príkazu:\n" +
                    "<b>XposeCraft.Game.BotRunner.Tutorial = false;</b>";
                break;
            }
            // If not any of first three states, proceed to the max state
            _state = _maxState;
        }
示例#13
0
    protected virtual void Awake()
    {
        finishStep = new TutorialStep(null, new StepStart(FinishStart), new StepCompletion(FinishCompletion));

        inputController.ChangePermissions(false, false, false, false);
    }
示例#14
0
    private void Update()
    {
        if (Input.GetKeyUp(27))
        {
            if ((!string.IsNullOrEmpty(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialBit) && !MonoBehaviourSingleton <UserInfoManager> .I.CheckTutorialBit(TUTORIAL_MENU_BIT.SKILL_EQUIP)) || !TutorialStep.HasAllTutorialCompleted())
            {
                if (MonoBehaviourSingleton <GameSceneManager> .IsValid())
                {
                    string currentSectionName = MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSectionName();

                    if (!string.IsNullOrEmpty(currentSectionName) && MonoBehaviourSingleton <ToastManager> .IsValid() && !MonoBehaviourSingleton <ToastManager> .I.IsShowingDialog())
                    {
                        string text = (!(MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSceneName() == "TitleScene")) ? StringTable.Get(STRING_CATEGORY.TEXT_SCRIPT, 36u) : "You are unable to go back to Town Scene during this Tutorial Mission";
                        ToastManager.PushOpen(text, 1.8f);
                    }
                }
            }
            else if (IsEnableTutorialMessage())
            {
                if (tutorialMessage.IsOnlyShowImage() && TutorialMessage.GetCursor(0) == null)
                {
                    tutorialMessage.TutorialClose();
                }
            }
            else if (!(tutorialMessage != null) || !(TutorialMessage.GetCursor(0) != null))
            {
                ProcessBackKey();
            }
        }
    }
示例#15
0
    public TutorialMessageData GetEnableExecTutorial(string section_name, bool is_force, bool is_new_section, string event_name = null)
    {
        TutorialReadData           save_data = Singleton <TutorialMessageTable> .I.ReadData;
        List <TutorialMessageData> list      = new List <TutorialMessageData>();

        tutorialSectionMessages.ForEach(delegate(TutorialMessageData o)
        {
            if (!(o.sectionName != section_name))
            {
                if (!TutorialStep.HasAllTutorialCompleted() && o.completedTutorialStep != -1)
                {
                    if (o.completedTutorialStep == 0 || (MonoBehaviourSingleton <UserInfoManager> .IsValid() && MonoBehaviourSingleton <UserInfoManager> .I.userStatus.tutorialStep >= o.completedTutorialStep) || (o.sceneName == "StatusScene" && o.sectionName == "StatusTop" && o.messageId == 1 && TutorialStep.isChangeLocalEquip))
                    {
                        return;
                    }
                }
                else if ((o.completedTutorialStep != 0 && o.completedTutorialStep != -1) || (!is_force && !o.GetFinishTutorialBit().HasValue&& o.completedTutorialStep >= 0 && save_data.HasRead(o.tutorialId)) || (o.appearId > 0 && !save_data.HasRead(o.appearId)) || (o.appearId < 0 && save_data.LastRead() != -o.appearId))
                {
                    return;
                }
                if (o.GetFinishTutorialBit().HasValue)
                {
                    TUTORIAL_MENU_BIT value = o.GetFinishTutorialBit().Value;
                    if (MonoBehaviourSingleton <UserInfoManager> .I.CheckTutorialBit(value))
                    {
                        return;
                    }
                }
                if (o.GetAppearTutorialBit().HasValue)
                {
                    TUTORIAL_MENU_BIT value2 = o.GetAppearTutorialBit().Value;
                    if (!MonoBehaviourSingleton <UserInfoManager> .I.CheckTutorialBit(value2))
                    {
                        return;
                    }
                }
                if ((o.appearDeliveryId == 0 || (MonoBehaviourSingleton <DeliveryManager> .IsValid() && MonoBehaviourSingleton <DeliveryManager> .I.IsClearDelivery((uint)o.appearDeliveryId))) && (!o.isNewSectionOnly || is_new_section))
                {
                    if (!string.IsNullOrEmpty(event_name))
                    {
                        if (o.triggerEventName != event_name)
                        {
                            return;
                        }
                    }
                    else if (!string.IsNullOrEmpty(o.triggerEventName))
                    {
                        return;
                    }
                    if ((!(o.sectionName == "WorldMap") && !(o.sectionName == "RegionMap")) || !string.IsNullOrEmpty(event_name) || !MonoBehaviourSingleton <WorldMapManager> .IsValid() || (!MonoBehaviourSingleton <WorldMapManager> .I.isDisplayQuestTargetMode() && !MonoBehaviourSingleton <WorldMapManager> .I.ignoreTutorial))
                    {
                        if (o.sectionName == "EquipSetDetailAttachSkillDialog" && !string.IsNullOrEmpty(o.checkKeyword))
                        {
                            uint target_id = uint.Parse(o.checkKeyword);
                            bool find_non_equip_attack_skill = false;
                            MonoBehaviourSingleton <InventoryManager> .I.ForAllSkillItemInventory(delegate(SkillItemInfo data)
                            {
                                if (!find_non_equip_attack_skill && data != null && data.tableData.type == SKILL_SLOT_TYPE.ATTACK && !data.isAttached && target_id != data.tableID)
                                {
                                    find_non_equip_attack_skill = true;
                                }
                            });
                            if (!find_non_equip_attack_skill)
                            {
                                return;
                            }
                            bool is_equip_first_slot = false;
                            if (MonoBehaviourSingleton <StatusManager> .I.GetLocalEquipSet() == null)
                            {
                                MonoBehaviourSingleton <StatusManager> .I.CreateLocalEquipSetData();
                            }
                            int eSetNo = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.eSetNo;
                            EquipItemInfo main_weapon = MonoBehaviourSingleton <StatusManager> .I.GetLocalEquipSet()[eSetNo].item[0];
                            if (main_weapon != null)
                            {
                                MonoBehaviourSingleton <InventoryManager> .I.ForAllSkillItemInventory(delegate(SkillItemInfo data)
                                {
                                    if (!is_equip_first_slot && data != null)
                                    {
                                        EquipSetSkillData equipSetSkillData = data.equipSetSkill.Find((EquipSetSkillData x) => x.equipSetNo == MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo());
                                        if (equipSetSkillData != null && equipSetSkillData.equipItemUniqId == main_weapon.uniqueID && equipSetSkillData.equipSlotNo == 0)
                                        {
                                            is_equip_first_slot = true;
                                        }
                                    }
                                });
                            }
                            if (!is_equip_first_slot)
                            {
                                int index = o.messageData.Count - 1;
                                o.messageData[index].waitEventName = o.messageData[index].waitEventName.Replace("_DETAIL", string.Empty);
                                Debug.LogWarning((object)("replace : " + o.messageData[index].waitEventName));
                            }
                        }
                        list.Add(o);
                    }
                }
            }
        });
        if (list.Count == 0)
        {
            return(null);
        }
        list.Sort((TutorialMessageData l, TutorialMessageData r) => l.messageId - r.messageId);
        return(list[0]);
    }
示例#16
0
 public static bool HasReadTutorialEnd()
 {
     return(TutorialStep.HasAllTutorialCompleted());
 }
 public void ChangeStep(TutorialStep nextStep)
 {
     step = nextStep;
     Save();
 }
 public void Init()
 {
     //load current tutorial saved from database, and continues
     step = (TutorialStep)GameManager.GameUser.Base.TutorStep;      // TutorialStep.Begin; //
 }
示例#19
0
 public void TutorialStop()
 {
     _state = TutorialStep.Disabled;
 }
    protected virtual void ShowSelectUI()
    {
        //IL_0240: Unknown result type (might be due to invalid IL or missing references)
        //IL_024f: Unknown result type (might be due to invalid IL or missing references)
        int num  = (!isInGameScene && TutorialStep.HasQuestSpecialUnlocked()) ? 1 : 2;
        int num2 = (showMode != 0) ? num : 0;
        int num3 = (showMode != SHOW_MODE.QUEST) ? num : 0;
        int num4 = (showMode != SHOW_MODE.ORDER) ? num : 0;

        SetActive((Enum)UI.OBJ_DELIVERY_ROOT, showMode == SHOW_MODE.DELIVERY);
        SetActive((Enum)UI.OBJ_QUEST_ROOT, showMode == SHOW_MODE.QUEST);
        SetActive((Enum)UI.OBJ_ORDER_ROOT, showMode == SHOW_MODE.ORDER);
        SetButtonSprite((Enum)UI.BTN_DELIVERY, "QuestTabBtnBase" + SPR_ON_OFF[num2], true);
        SetSprite((Enum)UI.SPR_DELIVERY_TEXT, "QuestTabBtnText" + SPR_INDEX[0] + SPR_ON_OFF[num2]);
        SetSprite((Enum)UI.SPR_DELIVERY_ICON, "QuestTabBtnIcon" + SPR_INDEX[0] + SPR_ON_OFF[num2]);
        SetButtonSprite((Enum)UI.BTN_QUEST, "QuestTabBtnBase" + SPR_ON_OFF[num3], true);
        SetSprite((Enum)UI.SPR_QUEST_TEXT, "QuestTabBtnText" + SPR_INDEX[1] + SPR_ON_OFF[num3]);
        SetSprite((Enum)UI.SPR_QUEST_ICON, "QuestTabBtnIcon" + SPR_INDEX[1] + SPR_ON_OFF[num3]);
        SetButtonSprite((Enum)UI.BTN_ORDER, "QuestTabBtnBase" + SPR_ON_OFF[num4], true);
        SetSprite((Enum)UI.SPR_ORDER_TEXT, "QuestTabBtnText" + SPR_INDEX[2] + SPR_ON_OFF[num4]);
        SetSprite((Enum)UI.SPR_ORDER_ICON, "QuestTabBtnIcon" + SPR_INDEX[2] + SPR_ON_OFF[num4]);
        if (!TutorialStep.HasQuestSpecialUnlocked())
        {
            SetButtonEnabled((Enum)UI.BTN_QUEST, false);
            SetButtonEnabled((Enum)UI.BTN_ORDER, false);
            SetActive((Enum)UI.BTN_EVENT, false);
        }
        if (!isInGameScene)
        {
            SetRenderNPCModel((Enum)UI.TEX_NPCMODEL, 0, MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.questCenterNPCPos, MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.questCenterNPCRot, MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.questCenterNPCFOV, (Action <NPCLoader>)null);
            SetLabelText((Enum)UI.LBL_NPC_MESSAGE, npcText);
        }
        SetActive((Enum)UI.OBJ_NPC_MESSAGE, !isInGameScene);
        if (showMode == SHOW_MODE.DELIVERY)
        {
            SetActive((Enum)UI.SPR_TAB_NORMAL, UI.BTN_TAB_NORMAL == selectedTab);
            SetActive((Enum)UI.SPR_TAB_DAILY, UI.BTN_TAB_DAILY == selectedTab);
            SetActive((Enum)UI.SPR_TAB_WEEKLY, UI.BTN_TAB_WEEKLY == selectedTab);
            SetButtonSprite((Enum)UI.BTN_TAB_NORMAL, (selectedTab != UI.BTN_TAB_NORMAL) ? "PickeShopBtn_Normal_off" : "PickeShopBtn_Green_on", false);
            SetButtonSprite((Enum)UI.BTN_TAB_DAILY, (selectedTab != UI.BTN_TAB_DAILY) ? "PickeShopBtn_Normal_off" : "PickeShopBtn_Green_on", false);
            SetButtonSprite((Enum)UI.BTN_TAB_WEEKLY, (selectedTab != UI.BTN_TAB_WEEKLY) ? "PickeShopBtn_Normal_off" : "PickeShopBtn_Green_on", false);
            SetNPCMessage(selectedTab);
            switch (selectedTab)
            {
            case UI.BTN_TAB_NORMAL:
                SetDeliveryList(normalDeliveryInfo);
                break;

            case UI.BTN_TAB_DAILY:
                SetDeliveryList(dailyDeliveryInfo);
                break;

            case UI.BTN_TAB_WEEKLY:
                SetDeliveryList(weeklyDeliveryInfo);
                break;
            }
        }
        else if (showMode == SHOW_MODE.ORDER)
        {
            if (questItemAry == null && MonoBehaviourSingleton <InventoryManager> .I.questItemInventory.GetCount() > 0)
            {
                List <QuestItemInfo> list = new List <QuestItemInfo>();
                MonoBehaviourSingleton <InventoryManager> .I.ForAllQuestInvetory(delegate(QuestItemInfo item)
                {
                    if (item.infoData.questData.num > 0)
                    {
                        list.Add(item);
                    }
                });

                questItemAry = list.ToArray();
                GetCtrl(UI.GRD_ORDER_QUEST).DestroyChildren();
            }
            if (questItemAry == null || questItemAry.Length == 0)
            {
                SetActive((Enum)UI.BTN_SORT, false);
                SetActive((Enum)UI.GRD_ORDER_QUEST, false);
                SetActive((Enum)UI.STR_ORDER_NON_LIST, true);
            }
            else
            {
                questSortData = sortSettings.CreateSortAry <QuestItemInfo, QuestSortData>(questItemAry);
                SetActive((Enum)UI.GRD_ORDER_QUEST, true);
                SetActive((Enum)UI.STR_ORDER_NON_LIST, false);
                SetActive((Enum)UI.BTN_SORT, true);
                SetLabelText((Enum)UI.LBL_SORT, sortSettings.GetSortLabel());
                SetToggle((Enum)UI.TGL_ICON_ASC, sortSettings.orderTypeAsc);
                SetDynamicList((Enum)UI.GRD_ORDER_QUEST, "QuestListOrderItem", questSortData.Length, false, (Func <int, bool>) null, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
                {
                    QuestSpecialSelect questSpecialSelect2 = this;
                    SetActive(t, true);
                    SetEvent(t, "SELECT_ORDER", i);
                    QuestInfoData info2 = this.questSortData[i].itemData.infoData;
                    int num9            = (int)(info2.questData.tableData.difficulty + 1);
                    int l = 0;
                    for (int num10 = difficult.Length; l < num10; l++)
                    {
                        SetActive(t, difficult[l], l < num9);
                    }
                    if (!is_recycle)
                    {
                        ResetTween(t, UI.TWN_DIFFICULT_STAR, 0);
                        PlayTween(t, UI.TWN_DIFFICULT_STAR, true, null, false, 0);
                    }
                    EnemyTable.EnemyData enemyData2 = Singleton <EnemyTable> .I.GetEnemyData((uint)info2.questData.tableData.GetMainEnemyID());
                    QuestSortData questSortData     = this.questSortData[i];
                    ItemIcon itemIcon2 = ItemIcon.Create(questSortData.GetIconType(), questSortData.GetIconID(), questSortData.GetRarity(), FindCtrl(t, UI.OBJ_ENEMY), questSortData.GetIconElement(), null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
                    itemIcon2.SetEnableCollider(false);
                    SetActive(t, UI.SPR_ELEMENT_ROOT, enemyData2.element != ELEMENT_TYPE.MAX);
                    SetElementSprite(t, UI.SPR_ELEMENT, (int)enemyData2.element);
                    SetElementSprite(t, UI.SPR_WEAK_ELEMENT, (int)enemyData2.weakElement);
                    SetActive(t, UI.STR_NON_WEAK_ELEMENT, enemyData2.weakElement == ELEMENT_TYPE.MAX);
                    SetLabelText(t, UI.LBL_QUEST_NAME, info2.questData.tableData.questText);
                    int num11 = 1;
                    ClearStatusQuest clearStatusQuest2 = MonoBehaviourSingleton <QuestManager> .I.clearStatusQuest.Find((ClearStatusQuest data) => info2.questData.tableData.questID == data.questId);
                    if (clearStatusQuest2 != null)
                    {
                        num11 = clearStatusQuest2.questStatus;
                    }
                    int value2 = i + 100;
                    SetToggleGroup(t, UI.OBJ_ICON_NEW, value2);
                    SetToggleGroup(t, UI.OBJ_ICON_CLEARED, value2);
                    SetToggleGroup(t, UI.OBJ_ICON_COMPLETE, value2);
                    switch (num11)
                    {
                    default:
                        SetToggle(t, UI.OBJ_ICON_NEW, false);
                        SetToggle(t, UI.OBJ_ICON_CLEARED, false);
                        SetToggle(t, UI.OBJ_ICON_COMPLETE, false);
                        break;

                    case 1:
                        SetToggle(t, UI.OBJ_ICON_NEW, true);
                        SetVisibleWidgetEffect(UI.SCR_ORDER_QUEST, t, UI.SPR_ICON_NEW, "ef_ui_questselect_new");
                        break;

                    case 3:
                        SetToggle(t, UI.OBJ_ICON_CLEARED, true);
                        break;

                    case 4:
                        SetToggle(t, UI.OBJ_ICON_COMPLETE, true);
                        SetVisibleWidgetEffect(UI.SCR_ORDER_QUEST, t, UI.SPR_ICON_COMPLETE, "ef_ui_questselect_complete");
                        break;
                    }
                    SetLabelText(t, UI.LBL_ORDER_NUM, info2.questData.num.ToString());
                    SetActive(t, UI.LBL_REMAIN, false);
                });
            }
        }
        else if (showMode == SHOW_MODE.QUEST)
        {
            if (questInfo == null || questInfo.Length == 0)
            {
                SetActive((Enum)UI.GRD_QUEST, false);
                SetActive((Enum)UI.STR_QUEST_NON_LIST, true);
            }
            else
            {
                SetActive((Enum)UI.STR_QUEST_NON_LIST, false);
                SetActive((Enum)UI.GRD_QUEST, true);
                SetDynamicList((Enum)UI.GRD_QUEST, "QuestListItem", questInfo.Length, false, (Func <int, bool>) null, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
                {
                    QuestSpecialSelect questSpecialSelect = this;
                    SetEvent(t, "SELECT_QUEST", i);
                    QuestInfoData info = questInfo[i];
                    int num5           = (int)(info.questData.tableData.difficulty + 1);
                    int j = 0;
                    for (int num6 = difficult.Length; j < num6; j++)
                    {
                        SetActive(t, difficult[j], j < num5);
                    }
                    if (!is_recycle)
                    {
                        ResetTween(t, UI.TWN_DIFFICULT_STAR, 0);
                        PlayTween(t, UI.TWN_DIFFICULT_STAR, true, null, false, 0);
                    }
                    EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)info.questData.tableData.GetMainEnemyID());
                    if (enemyData != null)
                    {
                        SetActive(t, UI.OBJ_ENEMY, true);
                        int iconId         = enemyData.iconId;
                        RARITY_TYPE?rarity = (info.questData.tableData.questType != QUEST_TYPE.ORDER) ? null : new RARITY_TYPE?(info.questData.tableData.rarity);
                        ItemIcon itemIcon  = ItemIcon.Create(ITEM_ICON_TYPE.QUEST_ITEM, iconId, rarity, FindCtrl(t, UI.OBJ_ENEMY), enemyData.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
                        itemIcon.SetEnableCollider(false);
                        SetActive(t, UI.SPR_ELEMENT_ROOT, enemyData.element != ELEMENT_TYPE.MAX);
                        SetElementSprite(t, UI.SPR_ELEMENT, (int)enemyData.element);
                        SetElementSprite(t, UI.SPR_WEAK_ELEMENT, (int)enemyData.weakElement);
                        SetActive(t, UI.STR_NON_WEAK_ELEMENT, enemyData.weakElement == ELEMENT_TYPE.MAX);
                    }
                    else
                    {
                        SetActive(t, UI.OBJ_ENEMY, false);
                        SetElementSprite(t, UI.SPR_WEAK_ELEMENT, 6);
                        SetActive(t, UI.STR_NON_WEAK_ELEMENT, true);
                    }
                    SetLabelText(t, UI.LBL_QUEST_NUM, string.Empty);
                    SetLabelText(t, UI.LBL_QUEST_NAME, info.questData.tableData.questText);
                    if (!info.isExistMission)
                    {
                        SetActive(t, UI.OBJ_MISSION_INFO_ROOT, false);
                    }
                    else
                    {
                        SetActive(t, UI.OBJ_MISSION_INFO_ROOT, true);
                        int k = 0;
                        for (int num7 = info.missionData.Length; k < num7; k++)
                        {
                            SetActive(t, ui_top_crown[k], info.missionData[k] != null);
                            if (info.missionData[k] != null)
                            {
                                SetActive(t, ui_crown[k], info.missionData[k].state >= CLEAR_STATUS.CLEAR);
                            }
                        }
                    }
                    int num8 = 1;
                    ClearStatusQuest clearStatusQuest = MonoBehaviourSingleton <QuestManager> .I.clearStatusQuest.Find((ClearStatusQuest data) => info.questData.tableData.questID == data.questId);
                    if (clearStatusQuest != null)
                    {
                        num8 = clearStatusQuest.questStatus;
                    }
                    int value = i + 100;
                    SetToggleGroup(t, UI.OBJ_ICON_NEW, value);
                    SetToggleGroup(t, UI.OBJ_ICON_CLEARED, value);
                    SetToggleGroup(t, UI.OBJ_ICON_COMPLETE, value);
                    switch (num8)
                    {
                    default:
                        SetToggle(t, UI.OBJ_ICON_NEW, false);
                        SetToggle(t, UI.OBJ_ICON_CLEARED, false);
                        SetToggle(t, UI.OBJ_ICON_COMPLETE, false);
                        break;

                    case 1:
                        SetToggle(t, UI.OBJ_ICON_NEW, true);
                        SetVisibleWidgetEffect(UI.SCR_NORMAL_QUEST, t, UI.SPR_ICON_NEW, "ef_ui_questselect_new");
                        break;

                    case 3:
                        SetToggle(t, UI.OBJ_ICON_CLEARED, true);
                        break;

                    case 4:
                        SetToggle(t, UI.OBJ_ICON_COMPLETE, true);
                        SetVisibleWidgetEffect(UI.SCR_NORMAL_QUEST, t, UI.SPR_ICON_COMPLETE, "ef_ui_questselect_complete");
                        break;
                    }
                });
            }
        }
    }
    public void UpdateIndex()
    {
        //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
        //IL_0197: Unknown result type (might be due to invalid IL or missing references)
        if (!(target == null) && target.weaponData != null)
        {
            EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData((uint)target.weaponData.eId);

            if (equipItemData != null)
            {
                SkillItemTable.SkillSlotData[] array = equipItemData.GetSkillSlot(target.weaponData.exceed);
                if (!TutorialStep.IsTheTutorialOver(TUTORIAL_STEP.USER_CREATE_02))
                {
                    array = new SkillItemTable.SkillSlotData[1]
                    {
                        new SkillItemTable.SkillSlotData()
                    };
                    array[0].slotType = SKILL_SLOT_TYPE.ATTACK;
                    array[0].skill_id = 0u;
                }
                int num = 0;
                int i   = 0;
                for (int num2 = array.Length; i < num2; i++)
                {
                    if (array[i].slotType != SKILL_SLOT_TYPE.ATTACK && array[i].slotType != SKILL_SLOT_TYPE.SUPPORT && array[i].slotType != SKILL_SLOT_TYPE.HEAL)
                    {
                        num++;
                    }
                }
                int num3 = 0;
                int j    = array.Length - num;
                for (int count = skillButtons.Count; j < count; j++)
                {
                    skillButtons[num3].get_gameObject().SetActive(false);
                    skillButtons[num3].SetButtonIndex(-1);
                    num3++;
                }
                int num4 = 0;
                int k    = 0;
                for (int num5 = array.Length; k < num5; k++)
                {
                    if (num3 >= skillButtons.Count)
                    {
                        break;
                    }
                    if (array[k].slotType == SKILL_SLOT_TYPE.ATTACK || array[k].slotType == SKILL_SLOT_TYPE.SUPPORT || array[k].slotType == SKILL_SLOT_TYPE.HEAL)
                    {
                        skillButtons[num3].get_gameObject().SetActive(true);
                        SkillInfo.SkillParam skillParam = target.skillInfo.GetSkillParam(target.skillInfo.weaponOffset + num4);
                        if (skillParam != null && skillParam.tableData.type == array[k].slotType)
                        {
                            skillButtons[num3].SetButtonIndex(num4);
                            num4++;
                        }
                        else
                        {
                            skillButtons[num3].SetInActiveSlot(array[k].slotType);
                        }
                        num3++;
                    }
                }
            }
        }
    }
示例#22
0
    public void Start()
    {
        focusTransform = focus.transform as RectTransform;
        TutorialStep confirmPlacementStep = new TutorialStep()
        {
            target    = placeTilesButton,
            msg       = "Confirm placement",
            condition = new BoolVariableCondition()
            {
                variable = possibleToPlace,
                value    = false
            }
        };

        steps = new ITutorialStep[] {
            //new ActionStep() {
            //    action = () => gridTouch.StartGame()
            //},
            new DelayStep()
            {
                seconds = 2
            },
            new ClickTutorialStep()
            {
                msg = "Click to begin"
            },
            new ClickTutorialStep()
            {
                target = card1,
                msg    = "Select sun"
            },
            new TutorialStep()
            {
                target    = middle,
                msg       = "Select tiles matching shape",
                condition = new BoolVariableCondition()
                {
                    variable = possibleToPlace,
                    value    = true
                }
            },
            confirmPlacementStep,
            new DelayStep()
            {
                seconds = 1
            },
            new ClickTutorialStep()
            {
                target = card1,
                msg    = "Select water"
            },
            new TutorialStep()
            {
                target    = middle,
                msg       = "Place next to sun",
                condition = new BoolVariableCondition()
                {
                    variable = possibleToPlace,
                    value    = true
                }
            },
            confirmPlacementStep,
            new DelayStep()
            {
                seconds = 1
            },
            new ClickTutorialStep()
            {
                target = waterCount,
                msg    = "Sun powers water generation"
            },
            new ClickTutorialStep()
            {
                target = card1,
                msg    = "Select astronauts"
            },
            new TutorialStep()
            {
                target    = middle,
                msg       = "Place anywhere",
                condition = new BoolVariableCondition()
                {
                    variable = possibleToPlace,
                    value    = true
                }
            },
            confirmPlacementStep,
            new DelayStep()
            {
                seconds = 1
            },
            new ClickTutorialStep()
            {
                msg = "Astronauts die without water"
            },
            new ClickTutorialStep()
            {
                target = card1,
                msg    = "Select research"
            },
            new TutorialStep()
            {
                target    = middle,
                msg       = "Place next to astronauts",
                condition = new BoolVariableCondition()
                {
                    variable = possibleToPlace,
                    value    = true
                }
            },
            confirmPlacementStep,
            new ClickTutorialStep()
            {
                msg    = "Active research generate points",
                target = score
            },
            new ClickTutorialStep()
            {
                target = card2,
                msg    = "Skip astronauts and select sun"
            },
            new ActionStep()
            {
                action = () => gridTouch.SetTargetShape(cardSelector.SelectCard(1))
            },
            new ClickTutorialStep()
            {
                msg = "The left shape will be discarded!"
            },
            new TutorialStep()
            {
                target    = middle,
                msg       = "Place next to water",
                condition = new BoolVariableCondition()
                {
                    variable = possibleToPlace,
                    value    = true
                }
            },
            confirmPlacementStep,
            new ClickTutorialStep()
            {
                msg = "You always have three shapes"
            },
            new ActionStep()
            {
                action = () => gameOverview.SetActive(true)
            },
            new DelayStep()
            {
                seconds = 6.2f
            },
            new ClickTutorialStep()
            {
                target = okButton,
            },
            new ActionStep()
            {
                action = () => gameOverview.SetActive(false)
            },
            new ClickTutorialStep()
            {
                msg = "Good luck!"
            },
            new ActionStep()
            {
                action = () => showTutorial.Value = false
            }
        };

        steps[currentStep].Start(this);
    }
 public void ResetAll()
 {
     this.nextStartFromId = 0;
     this.onGoingStep = null;
     this.onGoingStepIndex = 0;
 }
 public bool GetTutorialStepCompleted(TutorialStep step)
 {
     tutorialStepsCompleted.TryGetValue(step, out bool completed);
     return(completed);
 }
 private void ShowTutorialStep(TutorialStep step)
 {
     this.showingStepView = GameObjectUtil.InstantiateItemAsChildOf(this.showStepPrefab, base.gameObject);
     this.showingStepView.GetComponent<ShowTutorialStep>().SetStepConfig(step);
 }
    public override void UpdateUI()
    {
        //IL_0089: Unknown result type (might be due to invalid IL or missing references)
        //IL_0145: Unknown result type (might be due to invalid IL or missing references)
        //IL_014f: Unknown result type (might be due to invalid IL or missing references)
        //IL_01df: Unknown result type (might be due to invalid IL or missing references)
        //IL_01e4: Expected O, but got Unknown
        //IL_05e2: Unknown result type (might be due to invalid IL or missing references)
        //IL_05ff: Unknown result type (might be due to invalid IL or missing references)
        //IL_07e0: Unknown result type (might be due to invalid IL or missing references)
        //IL_07ed: Unknown result type (might be due to invalid IL or missing references)
        OpenTutorial();
        UpdateTitle();
        SetSprite(baseRoot, UI.SPR_WINDOW, SPR_WINDOW_TYPE[info.DeliveryTypeIndex()]);
        SetSprite(baseRoot, UI.SPR_MESSAGE_BG, SPR_MESSAGE_BG_TYPE[info.DeliveryTypeIndex()]);
        bool flag = false;

        if (Object.op_Implicit(submissionFrame))
        {
            UpdateSubMissionButton();
            UpdateSubMission();
            flag = submissionFrame.get_gameObject().get_activeSelf();
            SetActive((Enum)UI.STR_BTN_SUBMISSION, !flag);
            SetActive((Enum)UI.STR_BTN_SUBMISSION_BACK, flag);
        }
        Transform root = targetFrame;

        MonoBehaviourSingleton <DeliveryManager> .I.GetTargetEnemyData(deliveryID, out targetQuestID, out targetMapID, out string map_name, out string enemy_name, out DIFFICULTY_TYPE?difficulty, out targetPortalID);

        SetLabelText(root, UI.LBL_PLACE_NAME, map_name);
        MonoBehaviourSingleton <DeliveryManager> .I.GetAllProgressDelivery(deliveryID, out int have, out int need);

        SetLabelText(root, UI.LBL_HAVE, (!isComplete) ? have.ToString() : need.ToString());
        SetColor(root, UI.LBL_HAVE, (!isComplete) ? Color.get_red() : Color.get_white());
        SetLabelText(root, UI.LBL_NEED, need.ToString());
        SetLabelText(root, UI.LBL_NEED_ITEM_NAME, MonoBehaviourSingleton <DeliveryManager> .I.GetTargetItemName(deliveryID, 0u));
        if (info.IsDefeatCondition(0u))
        {
            if (targetQuestID != 0)
            {
                isQuestEnemy = true;
                Transform val   = FindCtrl(root, UI.OBJ_DIFFICULTY_ROOT);
                int       value = (int)difficulty.Value;
                int       j     = 0;
                for (int childCount = val.get_childCount(); j < childCount; j++)
                {
                    Transform t2 = val.GetChild(j);
                    SetActive(t2, j <= value);
                }
                SetLabelText(root, UI.LBL_GET_PLACE, base.sectionData.GetText("GET_QUEST"));
            }
            else
            {
                isQuestEnemy = false;
                SetLabelText(root, UI.LBL_GET_PLACE, base.sectionData.GetText("GET_AREA"));
            }
            SetLabelText(root, UI.LBL_ENEMY_NAME, string.Format(StringTable.Get(STRING_CATEGORY.TEXT_SCRIPT, 3u), enemy_name));
        }
        else
        {
            isQuestEnemy = false;
            SetLabelText(root, UI.LBL_GET_PLACE, StringTable.Get(STRING_CATEGORY.DELIVERY_CONDITION_PLACE, (uint)info.GetConditionType(0u)));
            SetLabelText(root, UI.LBL_ENEMY_NAME, enemy_name);
        }
        SetActive(root, UI.OBJ_DIFFICULTY_ROOT, isQuestEnemy);
        SetActive(root, UI.OBJ_ENEMY_NAME_ROOT, !isQuestEnemy);
        UpdateNPC(map_name, enemy_name);
        if ((isComplete || isNotice) && !isCompletedEventDelivery)
        {
            SetActive((Enum)UI.OBJ_BACK, false);
            SetActive((Enum)UI.BTN_CREATE, false);
            SetActive((Enum)UI.BTN_JOIN, false);
            SetActive((Enum)UI.BTN_MATCHING, false);
            UpdateUIJumpButton(JumpButtonType.Complete);
        }
        else
        {
            SetActive((Enum)UI.OBJ_BACK, true);
            bool flag2 = true;
            bool flag3 = false;
            if (info == null || info.IsDefeatCondition(0u) || targetMapID != 0)
            {
                if (isQuestEnemy)
                {
                    if (isInGameScene)
                    {
                        flag2 = false;
                    }
                }
                else
                {
                    bool flag4 = FieldManager.HasWorldMap(targetMapID);
                    if (isInGameScene)
                    {
                        if (MonoBehaviourSingleton <FieldManager> .I.currentMapID == targetMapID)
                        {
                            if (flag4)
                            {
                                flag3 = true;
                            }
                            else
                            {
                                flag2 = false;
                            }
                        }
                        else if (flag4)
                        {
                            if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(targetMapID) || WorldMapManager.IsValidPortalIDs(targetPortalID))
                            {
                                flag3 = true;
                            }
                        }
                        else if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(targetMapID))
                        {
                            flag2 = false;
                        }
                    }
                    else if (flag4)
                    {
                        if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(targetMapID) || WorldMapManager.IsValidPortalIDs(targetPortalID))
                        {
                            flag3 = true;
                        }
                    }
                    else if (!MonoBehaviourSingleton <FieldManager> .I.CanJumpToMap(targetMapID))
                    {
                        flag2 = false;
                    }
                }
            }
            else
            {
                flag2 = (info.GetDeliveryJumpType() != DeliveryTable.DELIVERY_JUMPTYPE.UNDEFINED);
            }
            JumpButtonType jumpButtonType = JumpButtonType.Invalid;
            if (flag2)
            {
                if (info != null && info.GetDeliveryJumpType() != 0)
                {
                    jumpButtonType = ConvertDeliveryJumpType();
                }
                else
                {
                    if (info != null)
                    {
                        QuestTable.QuestTableData questData = info.GetQuestData();
                        if (questData != null && questData.questType == QUEST_TYPE.WAVE)
                        {
                            jumpButtonType = JumpButtonType.WaveRoom;
                        }
                    }
                    if (jumpButtonType != JumpButtonType.WaveRoom)
                    {
                        jumpButtonType = ((!flag3) ? JumpButtonType.Quest : JumpButtonType.Map);
                    }
                }
                UpdateUIJumpButton(jumpButtonType);
            }
            else
            {
                SetActive(baseRoot, UI.BTN_JUMP_QUEST, false);
                SetActive(baseRoot, UI.BTN_JUMP_MAP, false);
                SetActive(baseRoot, UI.BTN_JUMP_GACHATOP, false);
                SetActive(baseRoot, UI.BTN_JUMP_INVALID, false);
                SetActive(baseRoot, UI.BTN_WAVEMATCH_NEW, false);
                SetActive(baseRoot, UI.BTN_WAVEMATCH_PASS, false);
                SetActive(baseRoot, UI.BTN_WAVEMATCH_AUTO, false);
                SetActive(baseRoot, UI.BTN_COMPLETE, false);
            }
            if (flag3 && MonoBehaviourSingleton <FieldManager> .I.currentMapID != targetMapID)
            {
                SetColor(baseRoot, UI.LBL_PLACE_NAME, Color.get_red());
            }
            else
            {
                SetColor(baseRoot, UI.LBL_PLACE_NAME, Color.get_white());
            }
        }
        int money = 0;
        int exp   = 0;

        if (rewardData != null)
        {
            SetGrid(baseRoot, UI.GRD_REWARD, string.Empty, rewardData.Length, false, delegate(int i, Transform t, bool is_recycle)
            {
                DeliveryRewardTable.DeliveryRewardData.Reward reward = rewardData[i].reward;
                bool is_visible = false;
                if (reward.type == REWARD_TYPE.MONEY)
                {
                    money += reward.num;
                }
                else if (reward.type == REWARD_TYPE.EXP)
                {
                    exp += reward.num;
                }
                else
                {
                    is_visible        = true;
                    ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon(reward.type, reward.item_id, t, reward.num, string.Empty, 0, false, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.REWARD_DELIVERY_DETAIL);
                    SetMaterialInfo(itemIcon.transform, reward.type, reward.item_id, null);
                    itemIcon.SetRewardBG(true);
                }
                SetActive(t, is_visible);
            });
        }
        SetLabelText(baseRoot, UI.LBL_MONEY, money.ToString());
        SetLabelText(baseRoot, UI.LBL_EXP, exp.ToString());
        SetActive(baseRoot, UI.OBJ_COMPLETE_ROOT, isComplete && !flag);
        SetActive(baseRoot, UI.OBJ_UNLOCK_PORTAL_ROOT, isComplete);
        if (isComplete)
        {
            string text = string.Empty;
            List <FieldMapTable.PortalTableData> deliveryRelationPortalData = Singleton <FieldMapTable> .I.GetDeliveryRelationPortalData(info.id);

            switch (deliveryRelationPortalData.Count)
            {
            case 1:
            {
                FieldMapTable.FieldMapTableData fieldMapData = Singleton <FieldMapTable> .I.GetFieldMapData(deliveryRelationPortalData[0].srcMapID);

                if (fieldMapData != null)
                {
                    text = fieldMapData.mapName;
                }
                break;
            }

            default:
                text = base.sectionData.GetText("MULTI_UNLOCK");
                break;

            case 0:
                break;
            }
            bool flag5 = !string.IsNullOrEmpty(text);
            if (!TutorialStep.HasFirstDeliveryCompleted())
            {
                flag5 = false;
            }
            SetActive(baseRoot, UI.OBJ_UNLOCK_PORTAL_ROOT, flag5 && !isCompletedEventDelivery);
            SetLabelText(baseRoot, UI.LBL_UNLOCK_PORTAL, text);
            if (isCompletedEventDelivery)
            {
                SkipTween(baseRoot, UI.OBJ_COMPLETE_ROOT, true, 0);
            }
            else
            {
                this.StartCoroutine(StartTweenCoroutine(flag5));
            }
        }
        this.StartCoroutine(SetPointShopGetPointUI());
    }
 public void StartTutorialTask()
 {
     if (this.nextStartFromId != 10)
     {
         if ((this.nextStartFromId > 0) && (this.nextStartFromId < 10))
         {
             this.onGoingTutorial = this.GetTutorialOfId(this.nextStartFromId);
             if (this.onGoingTutorial == null)
             {
                 return;
             }
             this.onGoingStepIndex = 0;
             this.onGoingStep = this.onGoingTutorial.steps[this.onGoingStepIndex];
         }
         this.CheckStepAppealAction(string.Empty);
     }
 }
示例#28
0
    public void UpdateBool(int id)
    {
        TutorialStep newStep = tutorialSteps[id];

        newStep.wasSeen = true;
    }
示例#29
0
 private void MoveBackwards()
 {
     CurrentStepIndex--;
     CurrentStep = TutorialSteps[CurrentStepIndex];
 }
示例#30
0
        public bool IsEnable()
        {
            switch (type)
            {
            case NPC_MESSAGE_TYPE.NONE:
                return(false);

            case NPC_MESSAGE_TYPE.ORDER_QUEST:
            {
                if (MonoBehaviourSingleton <InventoryManager> .I.questItemInventory.GetCount() == 0)
                {
                    return(false);
                }
                bool any_have = false;
                MonoBehaviourSingleton <InventoryManager> .I.ForAllQuestInvetory(delegate(QuestItemInfo quest_item)
                    {
                        if (!any_have && quest_item.infoData.questData.num > 0)
                        {
                            any_have = true;
                        }
                    });

                if (!any_have)
                {
                    return(false);
                }
                break;
            }

            case NPC_MESSAGE_TYPE.NEW_ORDER_QUEST:
            {
                if (MonoBehaviourSingleton <InventoryManager> .I.questItemInventory.GetCount() == 0)
                {
                    return(false);
                }
                bool find_not_clear_quest = false;
                if (param == 0)
                {
                    MonoBehaviourSingleton <InventoryManager> .I.ForAllQuestInvetory(delegate(QuestItemInfo quest_item)
                        {
                            if (!find_not_clear_quest && quest_item.infoData.questData.num != 0)
                            {
                                int num2 = MonoBehaviourSingleton <QuestManager> .I.clearStatusQuest.FindIndex((ClearStatusQuest clear_data) => clear_data.questId == quest_item.tableID && clear_data.questStatus >= 3);
                                if (num2 == -1)
                                {
                                    find_not_clear_quest = true;
                                }
                            }
                        });

                    if (!find_not_clear_quest)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem((uint)param) == null)
                    {
                        return(false);
                    }
                    int num = MonoBehaviourSingleton <QuestManager> .I.clearStatusQuest.FindIndex((ClearStatusQuest clear_data) => clear_data.questId == param && clear_data.questStatus >= 3);

                    if (num != -1)
                    {
                        return(false);
                    }
                }
                break;
            }

            case NPC_MESSAGE_TYPE.DELIVERY_QUEST:
            case NPC_MESSAGE_TYPE.NEW_DELIVERY_QUEST:
            {
                if (type == NPC_MESSAGE_TYPE.NEW_DELIVERY_QUEST && !GameSaveData.instance.IsRecommendedDeliveryCheck())
                {
                    return(false);
                }
                bool find_clear_status = false;
                bool find_not_clear    = false;
                MonoBehaviourSingleton <DeliveryManager> .I.clearStatusDelivery.ForEach(delegate(ClearStatusDelivery data)
                    {
                        if (!find_clear_status)
                        {
                            if (param != 0)
                            {
                                if (data.deliveryId == param)
                                {
                                    find_clear_status = true;
                                    if (data.deliveryStatus == 0)
                                    {
                                        find_not_clear = true;
                                    }
                                }
                            }
                            else if (data.deliveryStatus == 0)
                            {
                                find_clear_status = true;
                                find_not_clear    = true;
                            }
                        }
                    });

                Delivery[] deliveryList = MonoBehaviourSingleton <DeliveryManager> .I.GetDeliveryList(false);

                Delivery delivery = null;
                if (deliveryList.Length > 0 && param != 0)
                {
                    delivery = Array.Find(deliveryList, (Delivery data) => data.dId == param);
                }
                if (type == NPC_MESSAGE_TYPE.NEW_DELIVERY_QUEST)
                {
                    if (param != 0 && find_clear_status)
                    {
                        return(false);
                    }
                    if (param == 0 && deliveryList.Length <= MonoBehaviourSingleton <DeliveryManager> .I.clearStatusDelivery.Count)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (find_clear_status)
                    {
                        return(find_not_clear);
                    }
                    if (param == 0)
                    {
                        return(deliveryList.Length > 0);
                    }
                    if (delivery == null)
                    {
                        return(false);
                    }
                }
                break;
            }

            case NPC_MESSAGE_TYPE.ATTACK_OVER:
            case NPC_MESSAGE_TYPE.ATTACK_UNDER:
                MonoBehaviourSingleton <StatusManager> .I.CalcSelfStatusParam(MonoBehaviourSingleton <StatusManager> .I.GetEquipSet(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.eSetNo), out int _atk, out int _, out int _);

                if ((type == NPC_MESSAGE_TYPE.ATTACK_OVER && param > _atk) || (type == NPC_MESSAGE_TYPE.ATTACK_UNDER && param < _atk))
                {
                    return(false);
                }
                break;

            case NPC_MESSAGE_TYPE.CRYSTAL_OVER:
            case NPC_MESSAGE_TYPE.CRYSTAL_UNDER:
            {
                int crystal = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.crystal;
                if ((type == NPC_MESSAGE_TYPE.CRYSTAL_OVER && param > crystal) || (type == NPC_MESSAGE_TYPE.CRYSTAL_UNDER && param < crystal))
                {
                    return(false);
                }
                break;
            }

            case NPC_MESSAGE_TYPE.MONEY_OVER:
            case NPC_MESSAGE_TYPE.MONEY_UNDER:
            {
                int money = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.money;
                if ((type == NPC_MESSAGE_TYPE.MONEY_OVER && param >= money) || (type == NPC_MESSAGE_TYPE.MONEY_UNDER && param < money))
                {
                    return(false);
                }
                break;
            }

            case NPC_MESSAGE_TYPE.ITEM_HAVE:
            case NPC_MESSAGE_TYPE.ITEM_NOT_HAVE:
            {
                int haveingItemNum = MonoBehaviourSingleton <InventoryManager> .I.GetHaveingItemNum((uint)param);

                if ((type == NPC_MESSAGE_TYPE.ITEM_HAVE && haveingItemNum < 1) || (type == NPC_MESSAGE_TYPE.ITEM_NOT_HAVE && haveingItemNum > 0))
                {
                    return(false);
                }
                break;
            }

            case NPC_MESSAGE_TYPE.LEVEL_UP:
            {
                bool flag = GameSaveData.instance.lvupMessageFlag == 1;
                if (GameSaveData.instance.lvupMessageFlag != 0)
                {
                    GameSaveData.instance.lvupMessageFlag = 0;
                    GameSaveData.Save();
                }
                if (!flag)
                {
                    return(false);
                }
                break;
            }

            case NPC_MESSAGE_TYPE.TUTORIAL:
                if (TutorialStep.HasAllTutorialCompleted())
                {
                    return(false);
                }
                break;
            }
            return(true);
        }
    private void OnQuery_SELECT_EXPLORE()
    {
        int  num  = (int)GameSection.GetEventData();
        bool flag = MonoBehaviourSingleton <DeliveryManager> .I.IsCompletableDelivery(deliveryInfo[num].dId);

        int delivery_id = deliveryInfo[num].dId;

        if (flag)
        {
            DeliveryTable.DeliveryData table = Singleton <DeliveryTable> .I.GetDeliveryTableData((uint)deliveryInfo[num].dId);

            changeToDeliveryClearEvent = true;
            bool is_tutorial        = !TutorialStep.HasFirstDeliveryCompleted();
            bool enable_clear_event = table.clearEventID != 0;
            GameSection.StayEvent();
            MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
            MonoBehaviourSingleton <DeliveryManager> .I.SendDeliveryComplete(deliveryInfo[num].uId, enable_clear_event, delegate(bool is_success, DeliveryRewardList recv_reward)
            {
                if (is_success)
                {
                    List <FieldMapTable.PortalTableData> deliveryRelationPortalData = Singleton <FieldMapTable> .I.GetDeliveryRelationPortalData((uint)delivery_id);
                    for (int i = 0; i < deliveryRelationPortalData.Count; i++)
                    {
                        GameSaveData.instance.newReleasePortals.Add(deliveryRelationPortalData[i].portalID);
                    }
                    if (is_tutorial)
                    {
                        TutorialStep.isSendFirstRewardComplete = true;
                    }
                    if (!enable_clear_event)
                    {
                        MonoBehaviourSingleton <DeliveryManager> .I.isStoryEventEnd = false;
                        GameSection.ChangeStayEvent("EXPLORE_REWARD", new object[2]
                        {
                            delivery_id,
                            recv_reward
                        });
                    }
                    else
                    {
                        GameSection.ChangeStayEvent("CLEAR_EVENT", new object[3]
                        {
                            (int)table.clearEventID,
                            delivery_id,
                            recv_reward
                        });
                    }
                }
                else
                {
                    changeToDeliveryClearEvent = false;
                }
                GameSection.ResumeEvent(is_success, null);
            });
        }
        else
        {
            int num2 = (from x in MonoBehaviourSingleton <InventoryManager> .I.abilityItemInventory.GetAll()
                        where x.equipUniqueId == 0
                        select x).Count();
            if (num2 >= MonoBehaviourSingleton <UserInfoManager> .I.userStatus.maxAbilityItem)
            {
                GameSection.ChangeEvent("LIMIT_ABILITY_ITEM", null);
            }
            else
            {
                GameSection.SetEventData(new object[2]
                {
                    delivery_id,
                    null
                });
            }
        }
    }
示例#32
0
    // Start is called before the first frame update
    protected override void Awake()
    {
        var step1 = new TutorialStep();

        AddStep(step1);
        step1.Description = "There's still some things you should know!" +
                            "\n\nBefore we get st-st-arted, drag two INPUT instructions into the Solution Window.";
        step1.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("SolutionWindow");
        }
            );
        step1.AddCompletionCondition(
            () => {
            FocusInstruction(OpCode.INPUT);
            var container = FindObjectOfType <InstructionContainer>();
            int numInPlay = container.Count;
            return((numInPlay > 2) && DragNDrop.CurrDragInstruction == null);
        }
            );

        var step2 = new TutorialStep();

        AddStep(step2);
        step2.Description = "Fantastic! Did you know that Computrons know how to step?" +
                            "\n\nHit that big blue step button to make Computron execute a single instuction";
        step2.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("StepButton");
        }
            );

        step2.AddCompletionCondition(
            () => {
            var actor = FindObjectOfType <Actor>();
            return(actor.step == true);
        }
            );



        var step3 = new TutorialStep();

        AddStep(step3);
        step3.Description = "Go ahead and give the button another thwak";
        step3.AddBeginBehavior(
            () => {
            uiController.FocusUIElement("StepButton");
            var actor = FindObjectOfType <Actor>();
            //f****n cheat
            actor.step = false;
        }
            );
        step3.AddCompletionCondition(
            () => {
            var actor = FindObjectOfType <Actor>();
            return(actor.step == true);
        }
            );
        step3.AddEndBehavior(
            () => {
        }
            );

        var step4 = new TutorialStep();

        AddStep(step4);
        step4.Description = "One more fun fact, Computrons love to be helpful. " +
                            "\n\nClick on yours during any level and receive a fun fact! Give it a try now!";
        step4.AddBeginBehavior(
            () => {
            TextBoxController.gameObject.transform.position += new Vector3(5, 0);
        }
            );
        step4.AddCompletionCondition(
            () => {
            return(GameObject.FindGameObjectWithTag("HintBox") != null);
        }
            );
        step4.AddEndBehavior(
            () => {
            TextBoxController.gameObject.transform.position -= new Vector3(5, 0);
        }
            );
    }
示例#33
0
 public static void SetTutorialStepCompleted(TutorialStep step)
 {
     theInstance.SetTutorialStepCompleted(step);
     SaveData();
 }
示例#34
0
    private IEnumerator DoInitialize()
    {
        eventData = (SectionEventData)GameSection.GetEventData();
        if (MonoBehaviourSingleton <InGameManager> .IsValid())
        {
            portalData = Singleton <FieldMapTable> .I.GetPortalData(MonoBehaviourSingleton <InGameManager> .I.beforePortalID);
        }
        if (MonoBehaviourSingleton <OutGameSettingsManager> .IsValid() && portalData == null)
        {
            portalData = Singleton <FieldMapTable> .I.GetPortalData((uint)MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.linkFieldPortalID);
        }
        if (eventData.IsQuestToField())
        {
            portalData = Singleton <FieldMapTable> .I.GetPortalData(MonoBehaviourSingleton <FieldManager> .I.currentPortalID);
        }
        if (portalData == null)
        {
            base.Initialize();
        }
        else
        {
            FieldMapTable.FieldMapTableData currentMapData = Singleton <FieldMapTable> .I.GetFieldMapData(portalData.srcMapID);

            newMapData = Singleton <FieldMapTable> .I.GetFieldMapData(portalData.dstMapID);

            regionId = newMapData.regionId;
            if (NeedDirectionOpenRegion())
            {
                toRegionRelease = true;
                base.Initialize();
            }
            else
            {
                if (currentMapData != null && newMapData != null && newMapData.regionId != currentMapData.regionId)
                {
                    regionId = currentMapData.regionId;
                }
                if (newMapData == null || !IsValidRegion(newMapData))
                {
                    newMapData = null;
                    base.Initialize();
                }
                else
                {
                    LoadingQueue loadQueue          = new LoadingQueue(this);
                    LoadObject   loadedEventUIRoot  = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "NewFieldOpenEventUIRoot", false);
                    LoadObject   loadedLocationSpot = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "LocationSpot", false);
                    LoadObject   loadedEventCamera  = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "NewFieldEventCamera", false);
                    LoadObject   loadedFilterCamera = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "ZoomBlurFilterCamera", false);
                    LoadObject   loadedPlayerMarker = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "PlayerMarker", false);
                    LoadObject   loadedRegion       = loadQueue.Load(RESOURCE_CATEGORY.WORLDMAP, "RegionMap_" + regionId.ToString("D3"), false);
                    LoadObject   loadedEffect       = loadQueue.LoadEffect(RESOURCE_CATEGORY.EFFECT_UI, "ef_ui_map_fire_01", false);
                    LoadObject   loadedWindEffect   = loadQueue.LoadEffect(RESOURCE_CATEGORY.EFFECT_ACTION, "ef_btl_bg_questmap_01", false);
                    LoadObject   loadedDungeonEff   = null;
                    if (eventData.IsFindNewDungeon() && newMapData != null)
                    {
                        uint mapID = newMapData.mapID;
                        loadedDungeonEff = loadQueue.LoadEffect(RESOURCE_CATEGORY.EFFECT_DUNGEON, "DEF_" + mapID.ToString("D8"), false);
                    }
                    LoadObject loadedEncounterBossCutIn = null;
                    if (eventData.IsEncounterBossEvent())
                    {
                        loadedEncounterBossCutIn = loadQueue.Load(RESOURCE_CATEGORY.UI, "InGameFieldQuestWarning", false);
                    }
                    CacheAudio(loadQueue);
                    if (loadQueue.IsLoading())
                    {
                        yield return((object)loadQueue.Wait());
                    }
                    if (loadedEncounterBossCutIn != null)
                    {
                        fieldQuestWarningRoot = ResourceUtility.Realizes(loadedEncounterBossCutIn.loadedObject, -1).get_gameObject();
                        UIPanel panel = fieldQuestWarningRoot.GetComponentInChildren <UIPanel>();
                        if (panel != null)
                        {
                            panel.depth = 8000;
                        }
                        if (MonoBehaviourSingleton <UIInGameFieldQuestWarning> .IsValid())
                        {
                            MonoBehaviourSingleton <UIInGameFieldQuestWarning> .I.Load(loadQueue);
                        }
                    }
                    if (loadQueue.IsLoading())
                    {
                        yield return((object)loadQueue.Wait());
                    }
                    topEffectPrefab = loadedEffect.loadedObject;
                    Transform t = ResourceUtility.Realizes(loadedEventUIRoot.loadedObject, base._transform, -1);
                    regionMapRoot = ResourceUtility.Realizes(loadedRegion.loadedObject, MonoBehaviourSingleton <AppMain> .I._transform, -1).get_gameObject().GetComponent <RegionMapRoot>();
                    if (regionMapRoot != null)
                    {
                        bool wait = true;
                        regionMapRoot.InitPortalStatus(delegate
                        {
                            ((_003CDoInitialize_003Ec__Iterator164) /*Error near IL_0526: stateMachine*/)._003Cwait_003E__15 = false;
                        });
                        while (wait)
                        {
                            yield return((object)null);
                        }
                    }
                    blurFilter = (ResourceUtility.Instantiate <Object>(loadedFilterCamera.loadedObject) as GameObject).GetComponent <ZoomBlurFilter>();
                    blurFilter.get_transform().set_parent(base._transform);
                    _camera          = ResourceUtility.Realizes(loadedEventCamera.loadedObject, MonoBehaviourSingleton <AppMain> .I._transform, -1).GetComponent <Camera>();
                    uiFrontMapSprite = t.FindChild("FrontMap").get_gameObject().GetComponent <UITexture>();
                    if (uiFrontMapSprite != null)
                    {
                        uiFrontMapSprite.alpha = 0f;
                    }
                    uiMapSprite = t.FindChild("Map").get_gameObject().GetComponent <UITexture>();
                    InitMapSprite(MonoBehaviourSingleton <ScreenOrientationManager> .I.isPortrait);
                    if (eventData.IsEncounterBossEvent())
                    {
                        t.FindChild("TaptoSkip").get_gameObject().SetActive(false);
                    }
                    bgEventListener = UIEventListener.Get(t.Find("BG").get_gameObject());
                    tutorialTrigger = t.FindChild("TUTORIAL_TRIGGER");
                    if (tutorialTrigger != null)
                    {
                        if (!TutorialStep.HasAllTutorialCompleted())
                        {
                            tutorialTrigger.get_gameObject().SetActive(true);
                            UITweenCtrl.Play(tutorialTrigger, true, null, false, 0);
                        }
                        else
                        {
                            tutorialTrigger.get_gameObject().SetActive(false);
                        }
                    }
                    spots = new SpotManager(null, loadedLocationSpot.loadedObject as GameObject, _camera);
                    spots.spotRootTransform = t;
                    playerMarker            = ResourceUtility.Realizes(loadedPlayerMarker.loadedObject, -1);
                    PlayerMarker playerMarkerCom = playerMarker.GetComponent <PlayerMarker>();
                    if (null != playerMarkerCom)
                    {
                        playerMarkerCom.SetCamera(_camera.get_transform());
                    }
                    windEffect         = ResourceUtility.Realizes(loadedWindEffect.loadedObject, _camera.get_transform(), -1).get_gameObject().GetComponent <rymFX>();
                    windEffect.Cameras = (Camera[])new Camera[1]
                    {
                        _camera
                    };
                    windEffect.get_gameObject().set_layer(LayerMask.NameToLayer("WorldMap"));
                    if (loadedDungeonEff != null)
                    {
                        dungeonOpenEffect = ResourceUtility.Realizes(loadedDungeonEff.loadedObject, base._transform, -1);
                        dungeonOpenEffect.get_gameObject().SetActive(false);
                    }
                    CreateVisitedLocationSpot();
                    if (MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSceneName() == "InGameScene")
                    {
                        MonoBehaviourSingleton <ScreenOrientationManager> .I.OnScreenRotate += InitMapSprite;
                    }
                    base.Initialize();
                }
            }
        }
    }
    private void SetCurrentStep(TutorialStep tutorialStep)
    {
        foreach(var s in Steps)
        {
            if (s.ActivationItem != null)
                s.ActivationItem.gameObject.SetActive(false);
        }

        if (isDone)
            return;

        if(tutorialStep.ViewMode != HamburglarContext.Instance.Mode)
            HamburglarContext.Instance.SetView(tutorialStep.ViewMode);

        HamburglarSelectorSurface surface = GetSelectorSurface(tutorialStep.ViewMode);
        surface.FloorRayCastInterceptor = tutorialStep.FloorRayCastInterceptor == null
                                            ? (p, x) => { } // do nothing method
                                            : tutorialStep.FloorRayCastInterceptor;
        surface.RoomRayCastInterceptor = tutorialStep.RoomRayCastInterceptor == null
                                            ? (p, x) => { } // do nothing method
                                            : tutorialStep.RoomRayCastInterceptor;
        if (tutorialStep.ActivationItem != null)
        {
            tutorialStep.ActivationItem.gameObject.SetActive(true);
            tutorialStep.ActivationItem.SendMessage("StepActivated", SendMessageOptions.DontRequireReceiver);
        }
    }
示例#36
0
 public static bool GetShowTutorialStep(TutorialStep step)
 {
     return(theInstance.GetShowTutorial() && !theInstance.GetTutorialStepCompleted(step));
 }
示例#37
0
    private bool CheckMutualFollowBySNS()
    {
        string @string = PlayerPrefs.GetString("fc");

        if (!string.IsNullOrEmpty(@string))
        {
            MonoBehaviourSingleton <FriendManager> .I.MutualFollowValue = @string;
            PlayerPrefs.SetString("fc", string.Empty);
            if (MonoBehaviourSingleton <GameSceneManager> .I.IsExecutionAutoEvent() && TutorialStep.HasAllTutorialCompleted())
            {
                MonoBehaviourSingleton <GameSceneManager> .I.StopAutoEvent(null);
            }
            string name = "MAIN_MENU_HOME";
            if (LoungeMatchingManager.IsValidInLounge())
            {
                name = "MAIN_MENU_LOUNGE";
            }
            EventData[] autoEvents = new EventData[6]
            {
                new EventData(name, null),
                new EventData("MUTUAL_FOLLOW", null),
                new EventData("MAIN_MENU_MENU", null),
                new EventData("FRIEND", null),
                new EventData("FOLLOW_LIST", null),
                new EventData("MUTUAL_FOLLOW_MESSAGE", null)
            };
            if (TutorialStep.HasAllTutorialCompleted())
            {
                PlayerPrefs.SetString("fc", string.Empty);
                MonoBehaviourSingleton <GameSceneManager> .I.SetAutoEvents(autoEvents);

                return(true);
            }
        }
        return(false);
    }