求高手把下面这段js转换成C#

varscore=0;vartextureToDisplay:Texture2D;varscores:Texture2D[];vartimeLife=60;varcurr... var score=0;
var textureToDisplay:Texture2D;
var scores:Texture2D[];
var timeLife=60;
var currentDate;
var currentScore;
var now:Date;
var tempTexture;
var wbili=1.0f;
var hbili=1.0f;
function Awake () {
currentDate=PlayerPrefs.GetString("date");
currentScore=PlayerPrefs.GetString("score");
}
function OnTriggerEnter () {
score++;
}
daojishi();
function daojishi(){
while(timeLife>=-2){
yield new WaitForSeconds(1);
timeLife--;
}
}
function OnGUI(){
wbili=Screen.width/540.0;
hbili=Screen.height/960.0;
GUI.DrawTexture(Rect(0,0,540*wbili,150*hbili),textureToDisplay);
if(score<=9){
tempTexture = scores[score];
GUI.DrawTexture(Rect(100*wbili,48*hbili,22*wbili,80*hbili),tempTexture);
}else{
GUI.DrawTexture(Rect(100*wbili,48*hbili,22*wbili,80*hbili),scores[(score%10)]);
GUI.DrawTexture(Rect(60*wbili,48*hbili,22*wbili,80*hbili),scores[(score-score%10)/10]);
}
if(timeLife<=0){
GUI.DrawTexture(Rect(460*wbili,48*hbili,22*wbili,80*hbili),scores[(0)]);
}else if(timeLife<=9&&timeLife>0){
GUI.DrawTexture(Rect(460*wbili,48*hbili,22*wbili,80*hbili),scores[(timeLife)]);
}else{
GUI.DrawTexture(Rect(460*wbili,48*hbili,22*wbili,80*hbili),scores[(timeLife%10)]);
GUI.DrawTexture(Rect(420*wbili,48*hbili,22*wbili,80*hbili),scores[(timeLife-timeLife%10)/10]);
}
if(timeLife==0){
timeLife=-3;
now=System.DateTime.Now;
var temps=((now.Month+"").Length==1?("0"+now.Month):(""+now.Month))+"-"+((now.Day+"").Length==1?("0"+now.Day):(""+now.Day))+" "+((now.TimeOfDay.Hours+"").Length==1?("0"+now.TimeOfDay.Hours):(""+now.TimeOfDay.Hours))+":"
+((now.TimeOfDay.Minutes+"").Length==1?("0"+now.TimeOfDay.Minutes):(""+now.TimeOfDay.Minutes));
var tempdate="*"+temps+currentDate;
PlayerPrefs.SetString("date",tempdate);
var tempscoe="*"+((score<=9)?" "+score:""+score)+currentScore;
PlayerPrefs.SetString("score",tempscoe);
}
}
展开
 我来答
帐号已注销
2014-08-15 · TA获得超过419个赞
知道答主
回答量:74
采纳率:50%
帮助的人:30万
展开全部
这是unity3D吧,unity3D不同语言api都差不多的,你看关键代码就行了,不用逐字逐句,
冼慧雅3z
2014-08-12 · TA获得超过177个赞
知道小有建树答主
回答量:330
采纳率:100%
帮助的人:222万
展开全部
这是actionScript代码吧!并非js代码!
追问
这是js啊,我在unity3D上写的,不过没关系了,我的问题已经研究出来了,谢谢
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式