示例#1
0
        public Profile CreateProfile(string username, int avatarId)
        {
            Profile profile = new Profile(username, avatarId, false);
            AllProfiles.Add(username, profile);

            SaveProfiles();

            return profile;
        }
示例#2
0
        public void Victory(VictoryCondition endCondition)
        {
            if (endCondition == null)
            {
                return;
            }

            metWinCondition = endCondition;
            winner = metWinCondition.GetWinningPlayer();
        }
示例#3
0
        public static void SetCurrentProfile(Profile previousProfile, Profile currentProfile)
        {
            currentProfile.IsCurrentProfile = true;

            if (previousProfile == null)
            {
                return;
            }

            previousProfile.IsCurrentProfile = false;
        }
示例#4
0
        protected void Start()
        {
            profile = ProfileManager.Singleton.CurrentProfile;

            SetCursorState(CursorState.select);
            InitResources();
        }
示例#5
0
        protected void Start()
        {
            profile = ProfileManager.Singleton.CurrentProfile;
            if (profile == null)
            {
                return;
            }

            Debug.Log(string.Format("User: {0}", profile.Username));
        }
示例#6
0
        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);
            }
        }
示例#7
0
        protected void SetCurrentProfile(Profile profile)
        {
            Profile.SetCurrentProfile(CurrentProfile, profile);
            CurrentProfile = profile;
            SaveProfiles();

            UserInput userInput = GetComponent<UserInput>();
            if (userInput == null)
            {
                return;
            }

            userInput.profile = profile;
        }
示例#8
0
 protected string SerializeAccounts(Profile[] accounts)
 {
     string json = JsonConvert.SerializeObject(accounts);
     return json;
 }
示例#9
0
 public abstract bool HasPlayerMetWinConditions(Profile player);