コード例 #1
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;
 }
コード例 #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")
     {
         Shader sha = Shader.Find(image.shader);
         if (sha != null)
         {
             raw.material = new Material(sha);
         }
     }
     image.Context = raw;
 }