Exemple #1
0
 IEnumerator DoLoadAtlas(int aid)
 {
     if (!mAtlasList.ContainsKey(aid) || string.IsNullOrEmpty(mAtlasList[aid].Middle))
     {
         Debug.LogError("找不到图包[" + ((UIAtlasType)aid).ToString() + "]对应的资源!");
     }
     else
     {
         if (!mAtlasRefCounts.ContainsKey(aid))
         {
             ThreeData <UIAtlas, string, Vector2> data = mAtlasList[aid];
             yield return(StartCoroutine(DoLoadAtlas(data.Bgein, aid, data.Middle)));
         }
         mAtlasRefCounts[aid]++;
     }
 }
Exemple #2
0
        public static bool ReadNumber3Value <T1, T2, T3>(TValue v, out ThreeData <T1, T2, T3> value)
        //    where T1 : IConvertible
        //    where T2 : IConvertible
        //    where T3 : IConvertible
        {
            value = null;
            string numStr = ReadUtf8String(v);

            string[] ss = numStr.Split(":".ToCharArray());
            if (ss.Length <= 0)
            {
                return(true);
            }
            if (ss.Length != 3)
            {
                return(true);
            }
            T1 p1 = default(T1);
            T2 p2 = default(T2);
            T3 p3 = default(T3);

            if (!StringUtils.ToValueT(ss[0], out p1))
            {
                return(false);
            }
            if (!StringUtils.ToValueT(ss[1], out p2))
            {
                return(false);
            }
            if (!StringUtils.ToValueT(ss[2], out p3))
            {
                return(false);
            }
            value = new ThreeData <T1, T2, T3>(p1, p2, p3);
            return(true);
        }