Exemple #1
0
        private void AddPanel(PanelType type, string prefabPath, Panel_Depth depth = Panel_Depth.Zero)
        {
            GameObject prefab = ResourcesManager.GetGameObject(prefabPath);

            if (prefab)
            {
                GameObject panelGO = GDFunc.CreateGameObject(prefab, transform);
                AddPanel(type, panelGO.GetComponent <UIPanelBase>(), depth);
            }
            else
            {
                Debuger.LogError("ViewCenter AddPanel() Error !");
            }
        }
Exemple #2
0
        private void InitDialogueItems()
        {
            ShowDialogue(true);
            UIGrid grid = GameUtility.FindDeepChild(gameObject, "Dialogue_Items").GetComponent <UIGrid>();

            List <Transform> childList = grid.GetChildList();

            for (int i = 0; i < childList.Count; i++)
            {
                grid.RemoveChild(childList[i]);
                childList[i].gameObject.SetActive(false);
            }

            for (int i = 0; i < Tags.Audio_Name.Chat.Boy_Chat.Length; i++)
            {
                GameObject go = GDFunc.CreateGameObject(DialogueItemObj, grid.transform);
                go.GetComponentInChildren <UILabel>().text = Tags.Audio_Name.Chat.Boy_Chat[i];
                UIEventListener.Get(go).onClick            = delegate
                {
                    OnClickDialogue(go);
                };
                grid.AddChild(go.transform);
            }
        }