为什么C# DateTime函数识别不了
voidUpdate(){if(analog){TimeSpantimespan=DateTime.Now.TimeOfDay;hours.localRotation=Q...
void Update () {
if (analog)
{
TimeSpan timespan = DateTime.Now.TimeOfDay;
hours.localRotation =
Quaternion.Euler(0f,0f,(float)timespan.TotalHours * -hoursToDegrees);
minutes.localRotation =
Quaternion.Euler(0f,0f,(float)timespan.TotalMinutes * -minutesToDegrees);
seconds.localRotation =
Quaternion.Euler(0f,0f,(float)timespan.TotalSeconds * -secondsToDegrees);
}
else {
DateTime time = DateTime.Now;
hours.localRotation = Quaternion.Euler (0f, 0f, time.Hour * -hoursToDegrees);
minutes.localRotation = Quaternion.Euler (0f, 0f, time.Minute * -minutesToDegrees);
seconds.localRotation = Quaternion.Euler (0f, 0f, time.Second * -secondsToDegrees);
}
}
这个Date Time识别不了,老是说不存在??? 展开
if (analog)
{
TimeSpan timespan = DateTime.Now.TimeOfDay;
hours.localRotation =
Quaternion.Euler(0f,0f,(float)timespan.TotalHours * -hoursToDegrees);
minutes.localRotation =
Quaternion.Euler(0f,0f,(float)timespan.TotalMinutes * -minutesToDegrees);
seconds.localRotation =
Quaternion.Euler(0f,0f,(float)timespan.TotalSeconds * -secondsToDegrees);
}
else {
DateTime time = DateTime.Now;
hours.localRotation = Quaternion.Euler (0f, 0f, time.Hour * -hoursToDegrees);
minutes.localRotation = Quaternion.Euler (0f, 0f, time.Minute * -minutesToDegrees);
seconds.localRotation = Quaternion.Euler (0f, 0f, time.Second * -secondsToDegrees);
}
}
这个Date Time识别不了,老是说不存在??? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询