【发布时间】:2017-09-28 05:44:04
【问题描述】:
我目前正在使用带有 Unity3d 和 C# 的 Steamworks.net。我想做的是获取 Steam 用户 ID,在这种情况下是我自己的,然后执行一个函数。
这是我目前所拥有的:
private static float berdyevID = 76561198040013516;
private static float steamID;
void Start() {
if(SteamManager.Initialized) {
string name = SteamFriends.GetPersonaName();
// get steam user id
steamID = Steamworks.SteamUser.GetSteamID();
// see if it matches
if (berdyevID == steamID) {
Debug.Log ("Steam ID did match");
} else {
Debug.Log ("Steam ID did not match");
}
}
}
我从 Unity 收到一条错误消息:
无法隐式转换类型Steamworks.CSteamID' tofloat'。存在显式转换(您是否缺少演员表?)
这让我很困惑。我尝试在谷歌上进行研究以找到可能的解决方法,但找不到任何东西。有人可以帮忙吗?
编辑:
我试过了,但没用:
private static ulong berdyevID = 76561198040013516;
private static ulong steamID;
void Start() {
if(SteamManager.Initialized) {
string name = SteamFriends.GetPersonaName();
// get steam user id
steamID = Steamworks.SteamUser.GetSteamID();
// see if it matches
if (berdyevID == steamID) {
Debug.Log ("Steam ID did match");
} else {
Debug.Log ("Steam ID did not match");
}
}
}
【问题讨论】:
标签: c# unity3d steamworks-api