Пример #1
0
    void UICreated(bool isLoad)
    {
        if (isLoad == false)
        {
            isCanvasLoaded = true;

            // BChance: (2015-12-02) - Re-added chat window.
            obj1 = Instantiate(chatwindowObj);
            obj1.name = obj1.name.Substring(0, (obj1.name.Length - 7));

            obj1 = Instantiate(NPCdialogObj);
            obj1.name = obj1.name.Substring(0, (obj1.name.Length - 7));

            obj1 = Instantiate(CanvasObj);
            obj1.name = obj1.name.Substring(0, (obj1.name.Length - 7));

            obj1 = Instantiate(eventSysObj);
            obj1.name = obj1.name.Substring(0, (obj1.name.Length - 7));

            uimanager = gameObject.GetComponent<UIManager>();

            Panel_Audio = GameObject.Find("AudioPanel");
            Panel_ProgressReport = GameObject.Find("ProgressPanel");
            Panel_Inventory = GameObject.Find("InventoryPanel");
            Panel_Journal = GameObject.Find("JournalPanel");
            Panel_Map = GameObject.Find("MapPanel");

            Debug.Log("Panel_Audio: " + Panel_Audio);
            Debug.Log("Panel_ProgressReport: " + Panel_ProgressReport);
            Debug.Log("Panel_Inventory: " + Panel_Inventory);
            Debug.Log("Panel_Journal: " + Panel_Journal);
            Debug.Log("Panel_Map: " + Panel_Map);

            GameObject.Find("BtnAudio/Button Layer").GetComponent<Button>().onClick.AddListener(() => { uimanager.SoundAction(); });
            GameObject.Find("BtnInventroy/Button Layer").GetComponent<Button>().onClick.AddListener(() => { uimanager.InventoryAction(); });
            GameObject.Find("BtnJournal/Button Layer").GetComponent<Button>().onClick.AddListener(() => { uimanager.JournalAction(); });
            GameObject.Find("BtnProgress/Button Layer").GetComponent<Button>().onClick.AddListener(() => { uimanager.ProgressAction(); });
            GameObject.Find("BtnJournalMap/Button Layer").GetComponent<Button>().onClick.AddListener(() => { uimanager.MapAction(); });

            // DWhirle: (May 10, 2016)
            GameObject.Find("ImgRoleIcon").transform.GetChild(GLOBAL.Player.progress["playernum"].i - 1).gameObject.SetActive(true);

            isLoad = true;
            //StartCoroutine(waitForNPC());
        }
        else
        {

        }
        if (GameObject.Find("TopViewCamera") != null)
        {
            Panel_Map = GameObject.Find("TopViewCamera");
            //Panel_Map.SetActive(false);
        }
    }