ERROR CS 1525 Please help me!!
I was trying to put achievements in my steam game, but I found an error in the code that I can not solve. Can someone please help me? Here's the code: using UnityEngine; using System.Collections; using System.ComponentModel; using Steamworks;
// This is a port of StatsAndAchievements.cpp from SpaceWar, the official Steamworks Example. class SteamStatsAndAchievements : MonoBehaviour { private enum Achievement : int { ONE_ACHIEVEMENT_1_0, };
private Achievement_t[] m_Achievements = new Achievement_t[] {
new Achievement_t(Achievement.ONE_ACHIEVEMENT_1_0, "One", ""),
};
// Our GameID
private CGameID m_GameID;
// Did we get the stats from Steam?
private bool m_bRequestedStats;
private bool m_bStatsValid;
// Should we store stats this frame?
private bool m_bStoreStats;
// Current Stat details
private float m_flGameFeetTraveled;
private float m_ulTickCountGameStart;
private double m_flGameDurationSeconds;
// Persisted Stat details
private int m_nTotalGamesPlayed;
private int m_nTotalNumWins;
private int m_nTotalNumLosses;
private float m_flTotalFeetTraveled;
private float m_flMaxFeetTraveled;
private float m_flAverageSpeed;
protected Callback<UserStatsReceived_t> m_UserStatsReceived;
protected Callback<UserStatsStored_t> m_UserStatsStored;
protected Callback<UserAchievementStored_t> m_UserAchievementStored;
void OnEnable() {
if (!SteamManager.Initialized)
return;
// Cache the GameID for use in the Callbacks
m_GameID = new CGameID(SteamUtils.GetAppID(405801).ToString())); <-------Here there is the error
m_UserStatsReceived = Callback<UserStatsReceived_t>.Create(OnUserStatsReceived);
m_UserStatsStored = Callback<UserStatsStored_t>.Create(OnUserStatsStored);
m_UserAchievementStored = Callback<UserAchievementStored_t>.Create(OnAchievementStored);
// These need to be reset to get the stats upon an Assembly reload in the Editor.
m_bRequestedStats = false;
m_bStatsValid = false;
}
private void Update() {
if (!SteamManager.Initialized)
return;
The error is: Assets/Steamworks.NET-Example-master/Assets/Scripts/SteamStatsAndAchievements.cs(48,79): error CS1525: Unexpected symbol )', expecting
;'
Help me please!
Answer by Landern · Nov 18, 2015 at 06:39 PM
You have two many parenthesis when closing, remove one.
Original:
m_GameID = new CGameID(SteamUtils.GetAppID(405801).ToString()));
New:
m_GameID = new CGameID(SteamUtils.GetAppID(405801).ToString());
Now this is all with the assumption that this is show the CGameID is constructed and excepts a string.