原文:http://534064358.iteye.com/blog/797493
1.數值型到String型的轉化
假設該數值型(int/float/double)變數為:num 其轉化後得到的字元串為:str
則其轉化為字元串的方式為有三種,分別如下:
(1) str =
String.valueOf(num);
(2) str
=Integer.toString(num);
(3) str =num+"";
2.String型到數值型的轉化(此處以int為例,double,float類似)
其轉化方式有兩種,
分別如下:
(1) num=Integer.parseInt(str);
(2)
n...
閱讀全文
1.將iTween.cs拖到asset中的Plugins文件夾中(如果沒有則自己新建)
2.將iTweenPath.cs 拖到asset中的Plugins文件夾中(如果沒有則自己新建)
3.將iTweenPathEditor.cs 拖到asset中的Editor中(如果沒有則自己新建)
如此便可在javascript中正常調用iTween以及iTweenPath類
否則會出現 「UnityEditor」 can not be found 等錯誤
閱讀全文
提交表單之前通常需要簡單的驗證,假設該js方法名為validateCondition,這裡有兩種方法,每種方法都需要form和提交按鈕配套使用,否則驗證方法不生效。如下:
1、提交按鈕是button類型
<form action="xxx.do" name="formname" id="formname" method="post">
..........................................
<input type="button" value="保存" onclick="formSubmit(this,validateCondition);">
</form>
2、...
閱讀全文