- Код: Выделить всё
void onGUI()
{
GUI.DrawTexture(TextureRect(tex), tex);
RenderGUI();
}
void onGUI()
{
GUI.DrawTexture(TextureRect(tex), tex);
RenderGUI();
}
public GUIButton(Texture2D bmp,int frame){
Pos.width = bmp.width / frame;
Pos.height = bmp.height;
for (int i = 0; i < frame-1; i++)
{
Texture2D tmp = new Texture2D((int)Pos.width, (int)Pos.height);
Color[] pic = bmp.GetPixels((int)Pos.width * i, 0, (int)Pos.width, (int)Pos.height);
tmp.SetPixels(pic);
tex.Add(tmp);
}
public class GUIButton:GUIElement{
public int frame;
public List<Texture2D> tex;
public GUIButton(Texture2D bmp,int fr){
Bmap = bmp;
frame = fr;
Pos.width = bmp.width / frame;
Pos.height = bmp.height;
tex = new List<Texture2D>();
for (int i = 0; i < frame; i++)
{
Texture2D tmp = new Texture2D((int)Pos.width, (int)Pos.height);
tex.Add(tmp);
tmp.SetPixels(Bmap.GetPixels((int)Pos.width * i, 0, (int)Pos.width, (int)Pos.height));
tmp.Apply();
}
}
public override void Render()
{
GUI.DrawTexture(Pos, tex[0]);
}
}
public enum PanelType
{
Clamp =1,
Scale =2,
Repeat=3
}
public enum PanelType {Clamp, Scale, Repeat}
public PanelType panelType = PanelType.Clamp;
public enum int PanelType
{
Clamp =1,
Scale =2,
Repeat=3
}
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 11