using UnityEngine;
using System.Collections;
namespace LunarCatsStudio.SuperCombiner
{
///
/// Class storing data of a single _material to combine
///
public class MaterialToCombine
{
///
/// The _material to combine
///
public Material _material;
///
/// The maximum uv bounds for this _material
///
public Rect _uvBounds;
///
/// The _index of the combined _material
///
public int _combinedIndex;
///
/// Index of this element in it's list. This _index is equal to the combinedIdex
///
public int _index;
///
/// This is the mesh having the biggest UV bounds
///
public Mesh _meshHavingBiggestUVBounds;
///
/// Get the scaled and offseted by _material parameters uv bounds
///
///
public Rect GetScaledAndOffsetedUVBounds()
{
Rect rect = _uvBounds;
if (_material.HasProperty("_MainTex"))
{
rect.size = Vector2.Scale(rect.size, _material.mainTextureScale);
rect.position += _material.mainTextureOffset;
}
return rect;
}
}
}