Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. private void AdditionalInitialize()
  2.         {
  3.             foreach (string filename in Directory.GetFiles("../textures/"))
  4.             {
  5.                 ResourceCache.PrecacheResource<TextureResource>(filename);
  6.             }
  7.            
  8.             RenderInterface.Initialize();
  9.             RenderInterface.CurrentTexture = ResourceCache.GetResource<TextureResource>("../textures/3.jpg");
  10.  
  11.             for (int i = 1; i < 9; i++)
  12.             {
  13.                 for (int j = 0; j < 2; j++)
  14.                 {
  15.                     Card card = new Card(this);
  16.                     card.Texture = ResourceCache.GetResource<TextureResource>(String.Format("../textures/{0}.jpg", i));
  17.                     Cards.Add(card);
  18.                 }
  19.             }
  20.  
  21.             Cards = Cards.OrderBy(n => Guid.NewGuid()).ToList<Card>();
  22.  
  23.             int index = 0;
  24.             for (int i = -2; i < 2; i++)
  25.             {
  26.                 for (int j = -2; j < 2; j++)
  27.                 {
  28.                     Card card = Cards[index];
  29.                     card.Position = new Vector3(i * 3f, j * 3f, 0f);
  30.                     index++;
  31.                 }
  32.             }
  33.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement