(1)浮点型(float)保留小数
float y=8.2222f;
string s = Nun.ToString("F1");//F1代表保留着一位小数,F2 F3一次往后推
y = float.Parse(s)*; //y现在是8.2
(2)在Inspector面板显示的变量,可以使用它来帮你给变量加个描述
using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour
{
[Tooltip("提示生命值范围0-100")]
public int health = 0;
}
未完·······························