纳金网
标题:
c#脚本错误,能不能帮忙看一下?
[打印本页]
作者:
她。
时间:
2013-2-20 09:18
标题:
c#脚本错误,能不能帮忙看一下?
public class NewBehaviourScript : MonoBehaviour {
Object[] animLeft;
Texture2D map ;
Object[] tex ;
private int x;
private int nowFram;
private int mFrameCount;
private float fps= 10;
private float time= 0;
// Use this for initialization
void Start () {
animLeft = Resources.LoadAll("textureBG");
map = Resources.Load("Textures/1");
}
void OnGUI () {
GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height),map,ScaleMode.StretchToFill,***e,0);
DrawAnimation(animLeft,Rect(x,y,Screen.width,Screen.height));
x-=1;
}
void DrawAnimation (Object[] tex,Rect rect)
{
GUI.DrawTexture(rect,tex[nowFram],ScaleMode.StretchToFill,***e,0);
time +=Time.deltaTime;
if(time>=1.0/fps)
{
nowFram++;
time = 0;
if(nowFram >= mFrameCount)
{
nowFram = 0;
}
}
}
}
作者:
狂风大尉
时间:
2013-2-28 01:43
希望在新的一年里专心的学习好Unity!
欢迎光临 纳金网 (http://go.narkii.com/club/)
Powered by Discuz! X2.5