示例#1
0
    public void enterWorld()
    {
        // Set target for main camera to follow
        GameObject mainCamera = GameObject.FindGameObjectWithTag("MainCamera");

        mainCamera.transform.position              = playerSystem.transform.GetChild(0).transform.position;
        mainCamera.GetComponent <follow>().target  = playerSystem.transform.GetChild(0);
        mainCamera.GetComponent <follow>().enabled = true;
        // Set Gameplay UI to show up [child 2 of UI gameobject]
        loading.transform.parent.GetChild(1).gameObject.SetActive(true);
        //////////// Quest Part //////////////
        // Quest Success
        QuestContainer qcont = playerSystem.transform.GetChild(0).GetComponent <QuestContainer>();

        int[] questSuccessId = selectCharacter.GetQuestSuccess();
        foreach (int questID in questSuccessId)
        {
            Quest quest = QuestManager.GetQuestByID(questID);
            qcont.AddSuccessQuest(quest);
        }
        // Quest Process
        Dictionary <int, int> questProcess = selectCharacter.GetQuestProcess();

        foreach (KeyValuePair <int, int> data in questProcess)
        {
            Quest quest = QuestManager.GetQuestByID(data.Key);
            qcont.AddProcessQuest(quest, data.Value);
        }
        //////////// Quest Part //////////////
        // Enter world will auto fade loading screen off when finished load
        GameObject.Find("EnterGame").GetComponent <EnterGame>().EnterWorld(selectCharacter.GetCurrentMap());
    }