查看: 752|回复: 1
打印 上一主题 下一主题

c#脚本错误,能不能帮忙看一下?

[复制链接]

2508

主题

2

听众

3万

积分

资深设计师

Rank: 7Rank: 7Rank: 7

纳金币
32806
精华
12

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2013-2-20 09:18:22 |只看该作者 |倒序浏览
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;
   }
  }
}
}
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

2722

主题

42

听众

3万

积分

资深设计师

Rank: 7Rank: 7Rank: 7

纳金币
38268
精华
111

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

沙发
发表于 2013-2-28 01:43:16 |只看该作者
希望在新的一年里专心的学习好Unity!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2025-7-29 02:41 , Processed in 0.061214 second(s), 29 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部