示例#1
0
    public void CompleteHuntTask(GameObject go, bool completed)
    {
        string enemyName = go.name.Replace(" Variant", "");
        string taskSaver = playerDataSaver.GetHuntProgress();

        char[] taskSaverArray = taskSaver.ToCharArray();
        taskCompletion[enemyName] = completed;
        for (int i = 0; i < taskCompletion.Count; i++)
        {
            if (taskCompletion.ElementAt(i).Value == true)
            {
                taskSaverArray[i] = '1';
            }
            else
            {
                taskSaverArray[i] = '0';
            }
        }
        playerDataSaver.SetHuntProgress(new string(taskSaverArray));
        taskSaver = playerDataSaver.GetHuntProgress();
        if (taskCompletion.Values.All(val => val == true))
        {
            OnTaskCompleted(go, taskSaver, true);
        }
        else
        {
            OnTaskCompleted(go, taskSaver, false);
        }
        foreach (var item in taskCompletion)
        {
            Debug.Log(item.Key + " - " + item.Value + " =>>>>>>> " + taskSaver);
        }
    }