コード例 #1
0
 public static SpriteRectInfo[] FindSpriteUVs(string tName, string[] sns)
 {
     SpriteRectInfo[] infos = new SpriteRectInfo[sns.Length];
     for (int k = 0; k < SpriteDatas.Count; k++)
     {
         var fs = SpriteDatas[k].buffer.fakeStruct;
         if (fs != null)
         {
             var fsa = fs.GetData <FakeStructArray>(1);
             if (fsa != null)
             {
                 for (int i = 0; i < fsa.Length; i++)
                 {
                     var ts = fsa.GetData(i, 0) as string;
                     if (ts == tName)
                     {
                         fsa = fsa.GetData(i, 1) as FakeStructArray;
                         if (fsa != null)
                         {
                             for (int t = 0; t < sns.Length; t++)
                             {
                                 var sName = sns[t];
                                 for (int j = 0; j < fsa.Length; j++)
                                 {
                                     if (fsa.GetData(j, 0) as string == sName)
                                     {
                                         unsafe
                                         {
                                             Data.SpriteData.SpriteDataS *sp = (Data.SpriteData.SpriteDataS *)fsa[j];
                                             infos[t].txtSize = sp->txtSize;
                                             infos[t].rect    = sp->rect;
                                             infos[t].pivot   = sp->pivot;
                                         }
                                         break;
                                     }
                                 }
                             }
                         }
                         break;
                     }
                 }
             }
         }
     }
     return(infos);
 }
コード例 #2
0
 public static void FindSpriteUV(string tName, string sName, ref Rect rect, ref Vector2 txtSize, ref Vector2 pivot)
 {
     for (int k = 0; k < SpriteDatas.Count; k++)
     {
         var fs = SpriteDatas[k].buffer.fakeStruct;
         if (fs != null)
         {
             var fsa = fs.GetData <FakeStructArray>(1);
             if (fsa != null)
             {
                 for (int i = 0; i < fsa.Length; i++)
                 {
                     if (fsa.GetData(i, 0) as string == tName)
                     {
                         fsa = fsa.GetData(i, 1) as FakeStructArray;
                         if (fsa != null)
                         {
                             for (int j = 0; j < fsa.Length; j++)
                             {
                                 if (fsa.GetData(j, 0) as string == sName)
                                 {
                                     unsafe
                                     {
                                         Data.SpriteData.SpriteDataS *sp = (Data.SpriteData.SpriteDataS *)fsa[j];
                                         txtSize = sp->txtSize;
                                         rect    = sp->rect;
                                         pivot   = sp->pivot;
                                     }
                                 }
                             }
                         }
                         break;
                     }
                 }
             }
         }
     }
 }