public Profile CreateProfile(string username, int avatarId) { Profile profile = new Profile(username, avatarId, false); AllProfiles.Add(username, profile); SaveProfiles(); return profile; }
public void Victory(VictoryCondition endCondition) { if (endCondition == null) { return; } metWinCondition = endCondition; winner = metWinCondition.GetWinningPlayer(); }
public static void SetCurrentProfile(Profile previousProfile, Profile currentProfile) { currentProfile.IsCurrentProfile = true; if (previousProfile == null) { return; } previousProfile.IsCurrentProfile = false; }
protected void Start() { profile = ProfileManager.Singleton.CurrentProfile; SetCursorState(CursorState.select); InitResources(); }
protected void Start() { profile = ProfileManager.Singleton.CurrentProfile; if (profile == null) { return; } Debug.Log(string.Format("User: {0}", profile.Username)); }
public void LoadProfiles() { CurrentProfile = null; string fullPath = string.Format("{0}/{1}", Application.dataPath, ProfileSaveFile); string json = GlobalAssets.ReadTextFile(fullPath); if (json.Equals(string.Empty) == true) { return; } Profile[] loadedProfiles = DeserializeAccounts(json); foreach (Profile profile in loadedProfiles) { string username = profile.Username; AllProfiles.Add(username, profile); if (profile.IsCurrentProfile == false) { continue; } SetCurrentProfile(profile); } }
protected void SetCurrentProfile(Profile profile) { Profile.SetCurrentProfile(CurrentProfile, profile); CurrentProfile = profile; SaveProfiles(); UserInput userInput = GetComponent<UserInput>(); if (userInput == null) { return; } userInput.profile = profile; }
protected string SerializeAccounts(Profile[] accounts) { string json = JsonConvert.SerializeObject(accounts); return json; }
public abstract bool HasPlayerMetWinConditions(Profile player);