Пример #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);