Beispiel #1
0
    public void AddTutorialData(string type, TutorialData data)
    {
        TutorialData.TUTORIAL_TYPE enumType = TutorialData.TUTORIAL_TYPE.MAIN;

        if (type == "main")
        {
            enumType = TutorialData.TUTORIAL_TYPE.MAIN;
        }
        else if (type == "pose")
        {
            enumType = TutorialData.TUTORIAL_TYPE.POSE;
        }
        else if (type == "angle")
        {
            enumType = TutorialData.TUTORIAL_TYPE.ANGLE;
        }
        else if (type == "tempo")
        {
            enumType = TutorialData.TUTORIAL_TYPE.TEMPO;
        }

        if (TutorialDataList.ContainsKey(enumType))
        {
            TutorialDataList[enumType].Add(data);
        }
        else
        {
            TutorialDataList.Add(enumType, new List <TutorialData>());
            TutorialDataList[enumType].Add(data);
        }
    }
 public void Registrate(string username, string password)
 {
     username = User.PrepareUsername(username);
     using (var context = new TutorialData())
     {
         if (!UsernameIsValid(username))
         {
             throw new RegistrationException(Resources.ErrorUsername);
         }
         if (password.Length < MinPassword)
         {
             throw new RegistrationException(Resources.ErrorShortPassword);
         }
         if (context.Users.Any(u => u.Username.Equals(username)))
         {
             throw new RegistrationException(Resources.ErrorAlreadyExists);
         }
         password = User.PreparePassword(password);
         context.Users.Add(new User {
             Username = username, Password = password
         });
         context.SaveChanges();
     }
     this.username = username;
 }
Beispiel #3
0
    public void LoadTutorialData() //Json 파일 불러오기
    {
        string str2 = File.ReadAllText(Application.dataPath + "/TestJson.json");

        tutorialData = JsonUtility.FromJson <TutorialData>(str2);
        Debug.Log(tutorialData.tutorialCheck);
    }
    public static void CompleteTutorial(TutorialData tutData, int seeTime = 1)
    {
        if (!HasSeenTutorial(tutData))
        {
            if (!data.finishedTutorials.ContainsKey(tutData.Id))
            {
                data.finishedTutorials.Add(tutData.Id, 0);
            }
            data.finishedTutorials[tutData.Id] += 1;
            if (!cacheHasSeenTutorial.ContainsKey(tutData.Id))
            {
                cacheHasSeenTutorial.Add(tutData.Id, 0);
            }
            cacheHasSeenTutorial[tutData.Id] = data.finishedTutorials[tutData.Id];
            TutorialManager.activeTutorials.Remove(tutData.Id);

            if (tutData.saveOnDone)
            {
                TutorialManager.Save();
            }
            isShowing = false;
            onCompleteTutorial?.Invoke(tutData);
            FirebaseManager.LogEvent($"Tutorial_Done_{tutData.Id}");
        }
    }
 void ActivateTutorial(TutorialData tutorial)
 {
     _queue.Enqueue(tutorial);
     if (!_isPanelOpen) {
         OpenPanel();
     }
 }
Beispiel #6
0
        public void Restore()
        {
            byte[] data = ArchiveMgr.Instance.GetData(TutorialDataArchiveKey);

            if (null != data)
            {
                TutorialData.Deserialize(data);
            }

            data = ArchiveMgr.Instance.GetData(MetalScanDataArchiveKey);

            if (null != data)
            {
                MetalScanData.Deserialize(data);
            }

            data = ArchiveMgr.Instance.GetData(MessageDataArchveKey);

            if (null != data)
            {
                MessageData.Deserialize(data);
            }

            data = ArchiveMgr.Instance.GetData(MonsterHandbookDataArchveKey);

            if (null != data)
            {
                MonsterHandbookData.Deserialize(data);
            }
        }
 private void CheckAndShowDialogBox(TutorialData data)
 {
     if (data != null && !string.IsNullOrEmpty(data.header) && !string.IsNullOrEmpty(data.content))
     {
         dialogBox.ShowDialogBox(data.header, data.content);
     }
 }
 private void Init()
 {
     playerFleetData = new PlayerFleetData();
     pirates_AI_Data = new AI_Data();
     galaxyMapData = new GalaxyMapData();
     tutorialData = new TutorialData();
 }
Beispiel #9
0
    protected void GuideComplete()
    {
        if (OnComplete != null)
        {
            OnComplete(this, null);
        }
        Status = ExecuteStatus.End;
        //记录剩余次数
        TutorialData data = _TutorialManager.GetDataByID(GuideID);

        if (data != null && data.bAfterExeSub)
        {
            string account  = Util.CallMethod("UILoginCtrl", "GetAccount")[0].ToString();
            int    timeleft = PlayerPrefs.GetInt(account + GuideID.ToString(), -1);
            if (timeleft != -1)
            {
                timeleft -= 1;
                if (timeleft < 0)
                {
                    timeleft = 0;
                }
                PlayerPrefs.SetInt(account + GuideID.ToString(), timeleft);
            }
            else
            {
                timeleft = data.ExeTimes - 1;
                if (timeleft < 0)
                {
                    timeleft = 0;
                }
                PlayerPrefs.SetInt(account + GuideID.ToString(), timeleft);
            }
        }
    }
Beispiel #10
0
    private bool TryShowTutorial(string id, float x, float y)
    {
        if (GameManager.Instance.Settings.User.IsTutorialShowed(id) || Finished)
        {
            return(false);
        }

        if (!GameManager.Instance.Settings.User.Tutorials)
        {
            GameManager.Instance.Settings.User.SetTutorialShowed(id);
            return(false);
        }

        TutorialData data = GameManager.Instance.GameData.XMLtutorialsData[id];

        if (x != -6666)
        {
            data.X = x;
        }
        if (y != -6666)
        {
            data.Y = y;
        }
        if (CurrentTutorials.ContainsKey(id))
        {
            return(false);
        }
        else
        {
            ShowTutorial(data);
            return(true);
        }
    }
Beispiel #11
0
    protected override void SetOfflineData(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
    {
        TutorialData value = offlineDatabase.Read <TutorialData>();

        value.Init();
        offlineDatabase.Write(value);
    }
Beispiel #12
0
        public static ModuleItem GetModuleItem(TutorialData tutorialData)
        {
            ModuleItem item3;
            long       itemMarketId = tutorialData.TutorialStep.GetComponent <TutorialSelectItemDataComponent>().itemMarketId;

            using (IEnumerator <ModuleItem> enumerator = GarageItemsRegistry.Modules.GetEnumerator())
            {
                while (true)
                {
                    if (enumerator.MoveNext())
                    {
                        ModuleItem current = enumerator.Current;
                        long       id      = current.MarketItem.Id;
                        if (!id.Equals(itemMarketId))
                        {
                            continue;
                        }
                        item3 = current;
                    }
                    else
                    {
                        return(null);
                    }
                    break;
                }
            }
            return(item3);
        }
Beispiel #13
0
 public void New()
 {
     MetalScanData.Clear();
     //lz-2016.07.25 添加清空方法,在新游戏的时候清空保存的用户数据
     MessageData.Clear();
     TutorialData.Clear();
     MonsterHandbookData.Clear();
 }
        public override void RunStep(TutorialData data)
        {
            base.RunStep(data);
            CheckForSkipTutorial eventInstance = new CheckForSkipTutorial();

            TutorialStepHandler.EngineService.Engine.ScheduleEvent(eventInstance, data.TutorialStep);
            TutorialCanvas.Instance.ShowIntroDialog(data, eventInstance.canSkipTutorial);
        }
Beispiel #15
0
 private void OnTutorialEnd(TutorialData data)
 {
     if (LevelInfo.current.IsFirstLevel())
     {
         var btn = AbaTowerButton.GetComponentInChildren <Button>();
         Util.DisplayGlowUI(btn.transform);
         AbaTowerButton.GetComponentInChildren <Button>().interactable = true;
     }
 }
    private async void OnDismissed(TutorialData data)
    {
        dialogBox.CloseDialogBox();
        await System.Threading.Tasks.Task.Delay(200);

        EndTutorial();
        data.callback?.Invoke();
        tutorialActive = false;
    }
Beispiel #17
0
    public void Abort()
    {
        //中止
        foreach (var v in _Variables.Values)
        {
            if (v is GameObject)
            {
                GameObject go = v as GameObject;
                ResetLayer(go);
            }
        }

        HideTips();
        HidePointer();

        _waitItemID      = 0;
        _waitObjectPath  = null;
        _waitPopupType   = 0;
        _waitValueField  = null;
        _waitValueTarget = null;

        if (_waitClickTarget)
        {
            WaitClickHandle(_waitClickTarget);
        }

        _pc      = _stepLines.Length;
        _canNext = true;

        //记录剩余次数
        TutorialData data = _TutorialManager.GetDataByID(GuideID);

        if (data != null && data.bAfterExeSub)
        {
            string account  = Util.CallMethod("UILoginCtrl", "GetAccount")[0].ToString();
            int    timeleft = PlayerPrefs.GetInt(account + GuideID.ToString(), -1);
            if (timeleft != -1)
            {
                timeleft -= 1;
                if (timeleft < 0)
                {
                    timeleft = 0;
                }
                PlayerPrefs.SetInt(account + GuideID.ToString(), timeleft);
            }
            else
            {
                timeleft = data.ExeTimes - 1;
                if (timeleft < 0)
                {
                    timeleft = 0;
                }
                PlayerPrefs.SetInt(account + GuideID.ToString(), timeleft);
            }
        }
    }
Beispiel #18
0
 private void OnTutorialStart(TutorialData data)
 {
     if (LevelInfo.current.IsFirstLevel())
     {
         if (data.IsTapAbaButtonRequiredAction())
         {
             SlideInPanel(0);
         }
     }
 }
Beispiel #19
0
        public override void RunStep(TutorialData data)
        {
            base.RunStep(data);
            OpenTutorialContainerEvent eventInstance = new OpenTutorialContainerEvent {
                StepId = data.TutorialStep.GetComponent <TutorialStepDataComponent>().StepId,
                ItemId = data.TutorialStep.GetComponent <TutorialSelectItemDataComponent>().itemMarketId
            };

            TutorialStepHandler.EngineService.Engine.ScheduleEvent(eventInstance, TutorialStepHandler.EngineService.EntityStub);
            this.StepComplete();
        }
Beispiel #20
0
    protected override void PerformOfflineAction(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
    {
        TutorialData value = offlineDatabase.Read <TutorialData>();

        value.Init();
        offlineDatabase.Write(value);
        TutorialResponse = new TutorialResponse
        {
            tutorialBytes = new List <sbyte>(value.Bytes)
        };
    }
 public void DeSerialize(ref TutorialData tutorialData)
 {
     tutorialData.ShowTutorials = this.ShowTutorials;
 }
Beispiel #22
0
 // Use this for initialization
 void Awake()
 {
     if (battlebeardData == null) {
         battlebeardData = new TutorialData();
     }
     if(stormshaperData == null) {
         stormshaperData = new TutorialData();
     }
     addListeners();
 }
Beispiel #23
0
 void show(PlayerType p)
 {
     if (showing || p == PlayerType.None) { return; }
     if (p != currentPlayer) {
         currentData = (p == PlayerType.Battlebeard ? battlebeardData : stormshaperData);
         currentPlayer = p;
         CommanderImage.sprite = (p == PlayerType.Battlebeard ? BattlebeardImage : StormshaperImage);
     }
     if(currentData.NeverShow) { return; }
     HideToggle.isOn = false;
     showing = true;
     Lerp.LerpTo(In.position);
 }