Esempio n. 1
0
 public unsafe override void Load(FakeStruct fake)
 {
     data        = *(RawImageData *)fake.ip;
     color       = data.color;
     shader      = fake.buffer.GetData(data.shader) as string;
     assetName   = fake.buffer.GetData(data.assetName) as string;
     textureName = fake.buffer.GetData(data.textureName) as string;
 }
Esempio n. 2
0
 public static void LoadToObject(RawImage raw, ref RawImageData dat, RawImageElement image)
 {
     raw.uvRect        = dat.uvRect;
     raw.color         = image._color;
     raw.raycastTarget = false;
     if (image.shader != "Default UI Material")
     {
         raw.material = new Material(Shader.Find(image.shader));
     }
     if (image.textureName != null)
     {
         raw.texture = ElementAsset.FindTexture(image.assetName, image.textureName);
     }
     image.Context = raw;
 }
 public static void LoadToObject(RawImage raw, ref RawImageData dat, RawImageElement image)
 {
     raw.uvRect        = dat.uvRect;
     raw.color         = image._color;
     raw.raycastTarget = false;
     if (image.shader != "Default UI Material")
     {
         Shader sha = Shader.Find(image.shader);
         if (sha != null)
         {
             raw.material = new Material(sha);
         }
     }
     image.Context = raw;
 }