Exemplo n.º 1
0
    private MiniPetRetentionPet retentionScript;        // Reference to minipet logic

    public void InitializeContent(string taskID, MiniPetRetentionPet retentionScript)
    {
        this.retentionScript = retentionScript;
        rewardButton.SetActive(false);
        if (DataManager.Instance.GameData.Wellapad.CurrentTasks.ContainsKey("DailyInhaler"))
        {
            List <MutableDataWellapadTask> listTasks = WellapadMissionController.Instance.GetTaskGroup("TutorialPart1");
            task = listTasks[0];
            ImmutableDataWellapadTask missionTask = DataLoaderWellapadTasks.GetTask(task.TaskID);
            SetCheckboxSprite(true, slash1);
            task = listTasks[1];
            SetCheckboxSprite(true, slash2);
            ImmutableDataWellapadTask missionTask2 = DataLoaderWellapadTasks.GetTask(task.TaskID);
            mission1Localize.text = Localization.Localize("Task_" + missionTask.GetTaskID());
            mission2Localize.text = Localization.Localize("Task_" + missionTask2.GetTaskID());
            mission3Localize.gameObject.SetActive(false);
            mission4Localize.gameObject.SetActive(false);
            if (WellapadMissionController.Instance.GetTaskStatus(listTasks[0]) == WellapadTaskCompletionStates.Completed &&
                WellapadMissionController.Instance.GetTaskStatus(listTasks[1]) == WellapadTaskCompletionStates.Completed)
            {
                rewardButton.SetActive(true);
                GameObject peb = MiniPetManager.Instance.MiniPetTable["MiniPet0"];
                rewardButton.GetComponent <Button>().onClick.AddListener(() => peb.GetComponent <MiniPetRetentionPet>().OnTurnInButton());
            }
        }
        else
        {
//			Debug.Log(DataManager.Instance.GameData.Wellapad.CurrentTasks[taskID].RewardStatus);
            if (DataManager.Instance.GameData.Wellapad.CurrentTasks[taskID].isReward == RewardStatuses.Unclaimed ||
                DataManager.Instance.GameData.Wellapad.CurrentTasks[taskID].isReward == RewardStatuses.Unearned)
            {
                //Debug.Log(taskID);
                List <MutableDataWellapadTask> listTasks = WellapadMissionController.Instance.GetTaskGroup("Critical");
                task = listTasks[0];
                SetCheckboxSprite(true, slash1);
                ImmutableDataWellapadTask missionTask = DataLoaderWellapadTasks.GetTask(task.TaskID);
                rewardButton.GetComponent <LgWorldButtonMessage>().target = MiniPetManager.Instance.MiniPetTable["MiniPet0"];
                task = listTasks[1];
                SetCheckboxSprite(true, slash2);
                ImmutableDataWellapadTask missionTask2 = DataLoaderWellapadTasks.GetTask(task.TaskID);
                task = listTasks[2];
                SetCheckboxSprite(true, slash3);
                ImmutableDataWellapadTask missionTask3 = DataLoaderWellapadTasks.GetTask(task.TaskID);
                if (WellapadMissionController.Instance.GetTaskStatus(listTasks[0]) == WellapadTaskCompletionStates.Completed && WellapadMissionController.Instance.GetTaskStatus(listTasks[1]) == WellapadTaskCompletionStates.Completed && WellapadMissionController.Instance.GetTaskStatus(listTasks[2]) == WellapadTaskCompletionStates.Completed)
                {
                    rewardButton.SetActive(true);
                }
                mission1Localize.text = Localization.Localize("Task_" + missionTask.GetTaskID());
                mission2Localize.text = Localization.Localize("Task_" + missionTask2.GetTaskID());
                mission3Localize.text = Localization.Localize("Task_" + missionTask3.GetTaskID());
                mission4Localize.gameObject.SetActive(false);
            }
        }
    }
Exemplo n.º 2
0
 public MutableDataWellapadTask(ImmutableDataWellapadTask data, WellapadTaskCompletionStates completionStatus = WellapadTaskCompletionStates.Uncompleted)
 {
     TaskID = data.GetTaskID();
     if (data.GetCategory() == "Critical")
     {
         Category = MiniGameCategory.Critical;
     }
     else
     {
         Category = MiniGameCategory.Regular;
     }
     Amount    = data.GetRandomCompleteCondition();
     Completed = completionStatus;
 }