Exemplo n.º 1
0
 public void SetMaterial(Material mat, SWData data, Sprite sprite)
 {
     if (data.shaderType == SWShaderType.sprite)
     {
         int orginWidth  = 0;
         int orginHeight = 0;
         if (sprite != null && SWCommon.TexureOriginSize(sprite.texture, out orginWidth, out orginHeight))
         {
             Init();
             material = mat;
             float mulX = (float)orginWidth / (float)sprite.texture.width;
             float mulY = (float)orginHeight / (float)sprite.texture.height;
             preview.SetMaterial(mat, data, sprite, mulX, mulY);
         }
     }
     else
     {
         Init();
         material = mat;
         preview.SetMaterial(mat, data, sprite, 0, 0);
     }
 }
 public void SetMaterial(Material mat, SWData data, Sprite sprite)
 {
     Init();
     material = mat;
     preview.SetMaterial(mat, data, sprite);
 }