【发布时间】:2015-11-09 14:49:01
【问题描述】:
我正在搞乱我玩的游戏的源代码,我正在制作游戏内命令,但我遇到了问题。
public enum WeatherType
{
None = 1,
Rain = 2,
Snow = 3,
RainWind = 4,
AutumnLeaves = 5,
CherryBlossomPetals = 7,
CherryBlossomPetalsWind = 8,
BlowingCotten = 9,
Atoms = 10
}
GC.MyClient.SendPacket(General.MyPackets.Weather(Splitter[1], Convert.ToUInt32(Splitter[2]), Convert.ToUInt32(Splitter[3]), Convert.ToUInt32(Splitter[4])));
错误出现在 Splitter[1] 上,它显示“无法将字符串转换为 WeatherType”。 有谁知道如何解决这一问题?因为我真的很难过。谢谢
【问题讨论】:
-
在这种情况下,您必须将其类型转换为
WeatherType。 -
向我们展示
Splitter包含什么以及General.MyPackets.Weather期望/做什么可能会有所帮助