Пример #1
0
    public static T Attach <T>(Transform toTrans, bool useAnim = true) where T : UIWorldBase
    {
        T template = TResources.Instantiate <T>("UI/World/" + typeof(T).ToString(), toTrans);

        template.Init(useAnim);
        return(template);
    }
Пример #2
0
    public static void SetRegion(enum_Option_LanguageRegion location)
    {
        if (e_CurLocation == location)
        {
            return;
        }

        e_CurLocation = location;

        List <string[]> data = TExcel.Tools.ReadExcelFirstSheetData(TResources.GetExcelData("SLocalization"));

        for (int i = 1; i < data[0].Length; i++)
        {
            if (data[0][i] != ((enum_Option_LanguageRegion)i).ToString())
            {
                Debug.LogError("SLocalizataion Not Init Propertly:" + i.ToString());
            }
        }

        CurLocalization.Clear();
        int localizeIndex = (int)e_CurLocation;

        for (int i = 0; i < data.Count; i++)
        {
            CurLocalization.Add(data[i][0], data[i][localizeIndex]);
        }
        OnLocaleChanged?.Invoke();
        IsInit = true;
    }
Пример #3
0
    public static UIPageBase Generate(Type type, Transform parentTransform)
    {
        UIPageBase page = TResources.Instantiate <UIPageBase>("UI/Pages/" + type.ToString(), parentTransform);

        page.Init();
        return(page);
    }
Пример #4
0
    public static T Show <T>(Transform _parentTrans) where T : UIControlBase
    {
        T tempBase = TResources.Instantiate <T>("UI/Controls/" + typeof(T).ToString(), _parentTrans);

        tempBase.Init();
        return(tempBase);
    }
Пример #5
0
    public static T Show <T>(Transform _parentTrans) where T : UIMessageBoxBase
    {
        if (m_MessageBox)
        {
            Debug.LogError("Can't Open Another MessageBox While One Is Active");
            return(null);
        }

        T messageBox = TResources.Instantiate <T>("UI/MessageBoxes/" + typeof(T).ToString(), _parentTrans);

        messageBox.Init();
        return(messageBox);
    }
Пример #6
0
    public static T Show <T>(Transform parentTransform, bool useAnim) where T : UIPageBase
    {
        if (Opening <T>())
        {
            return(null);
        }
        T page = TResources.Instantiate <T>("UI/Pages/" + typeof(T).ToString(), parentTransform);

        page.Init();
        page.Play(useAnim);
        m_Pages.Add(page);
        return(page);
    }
Пример #7
0
        public static void Init()
        {
            m_AllProperties = new Dictionary <int, List <T> >();
            Dictionary <int, List <string[]> > m_AllDatas = Tools.ReadExcelMultipleSheetData(TResources.GetExcelData(typeof(T).Name));

            for (int i = 0; i < m_AllDatas.Count; i++)
            {
                m_AllProperties.Add(i, Tools.GetFieldData <T>(m_AllDatas[i]));
            }
        }
Пример #8
0
 public static void Init()
 {
     m_Properties = Tools.GetFieldData <T>(Tools.ReadExcelFirstSheetData(TResources.GetExcelData(typeof(T).Name, false)));
 }