public void LoadDownloadWorkoutData() { _data = LoadXML(ServerURL + "Download/" + _DownloadWorkoutDataFileName); if (UserDownloadWorkoutDataString.ToString() != "") { //UserDownloadWorkoutData = (SaveDownloadWorkoutData)DeserializeObject(_data, "SaveDownloadWorkoutData"); UserDownloadWorkoutData = (SaveDownloadWorkoutData)DeserializeObject(UserDownloadWorkoutDataString, "SaveDownloadWorkoutData"); } }
public void Init() { Initialize = false; DownloadWorkoutList = new List <string> (); DownloadWorkoutData = new List <WorkoutData>(); DownloadWorkoutFileList = new List <string>(); UserDownloadWorkoutData = UserBlobManager.GetComponent <UserBlobManager>().UserDownloadWorkoutData; SelectedWorkout = -1; ClearScrollList(); PopulateScrollList(); if (UserBlobManager.GetComponent <UserBlobManager> ().UserDownloadWorkoutData.DownloadWorkout.Length > 6) { SetScrollRectPositionFromIntWithOffset(0, 2.5, 200, UserBlobManager.GetComponent <UserBlobManager> ().UserDownloadWorkoutData.DownloadWorkout.Length, WorkoutContentPanel); } else { WorkoutContentPanel.localPosition = new Vector3(0, 0, 0); } }
// Use this for initialization void Start() { UserDownloadWorkoutData = new SaveDownloadWorkoutData(); }
// Use this for initialization void Awake() { VersionNumber = "1.0"; ExerciseTypeList.Clear(); ExerciseTypeList.Add("General"); ExerciseTypeList.Add("Warm-Up"); ExerciseTypeList.Add("Stretch"); ExerciseTypeList.Add("Weights"); ExerciseTypeList.Add("Cardio-Light"); ExerciseTypeList.Add("Cardio-Moderate"); ExerciseTypeList.Add("Cardio-Intense"); ExerciseTypeList.Add("Yoga"); ExerciseTypeList.Add("Body Weight"); ExerciseTypeList.Add("Cross-Fit"); ExerciseTypeList.Add("Fighting"); WorkoutTypeList.Clear(); WorkoutTypeList.Add("General"); WorkoutTypeList.Add("Warm-Up"); WorkoutTypeList.Add("Stretch"); WorkoutTypeList.Add("Weights"); WorkoutTypeList.Add("Cardio"); WorkoutTypeList.Add("Yoga"); WorkoutTypeList.Add("Fighting"); WorkoutTypeList.Add("Cross-Fit"); TrainingTypeList.Clear(); TrainingTypeList.Add("General"); TrainingTypeList.Add("Warm-Up"); TrainingTypeList.Add("Stretch"); TrainingTypeList.Add("Weights"); TrainingTypeList.Add("Cardio"); TrainingTypeList.Add("Yoga"); TrainingTypeList.Add("Fighting"); TrainingTypeList.Add("Cross-Fit"); BodyPartList.Clear(); BodyPartList.Add("Body"); BodyPartList.Add("Arms"); BodyPartList.Add("Abs"); BodyPartList.Add("Back"); BodyPartList.Add("Chest"); BodyPartList.Add("Core"); BodyPartList.Add("Legs"); BodySide.Clear(); BodySide.Add("None"); BodySide.Add("Left"); BodySide.Add("Right"); NumberList.Clear(); NumberList.Add(0); NumberList.Add(1); NumberList.Add(2); NumberList.Add(3); NumberList.Add(4); NumberList.Add(5); NumberList.Add(6); NumberList.Add(7); NumberList.Add(8); NumberList.Add(9); NumberListToFive.Clear(); NumberListToFive.Add(0); NumberListToFive.Add(1); NumberListToFive.Add(2); NumberListToFive.Add(3); NumberListToFive.Add(4); NumberListToFive.Add(5); YesNoList.Clear(); YesNoList.Add("Yes"); YesNoList.Add("No"); MonthList.Clear(); MonthList.Add("January"); MonthList.Add("February"); MonthList.Add("March"); MonthList.Add("April"); MonthList.Add("May"); MonthList.Add("June"); MonthList.Add("July"); MonthList.Add("August"); MonthList.Add("September"); MonthList.Add("October"); MonthList.Add("November"); MonthList.Add("December"); FilterExerciseTypeList.Clear(); FilterExerciseTypeList.Add("None"); foreach (string item in ExerciseTypeList) { FilterExerciseTypeList.Add(item); } FilterBodyPartList.Clear(); FilterBodyPartList.Add("None"); foreach (string item in BodyPartList) { FilterBodyPartList.Add(item); } UIManager = GameObject.Find("UI_Manager_Prefab"); UserDownloadTrainingData = new SaveDownloadTrainingData(); UserDownloadWorkoutData = new SaveDownloadWorkoutData(); UserDownloadExerciseData = new SaveDownloadExerciseData(); UserDownloadTrainingDataString = ""; UserDownloadWorkoutDataString = ""; UserDownloadExerciseDataString = ""; UserWorkoutData = new SaveWorkoutData(); UserExerciseData = new SaveExerciseData(); UserFriendData = new SaveFriendData(); UserTrainingData = new SaveTrainingData(); UserDayData = new SaveDayData(); _FileLocation = Application.persistentDataPath; _DownloadTrainingDataFileName = "DownloadTrainingData.xml"; // temporarily get these locally. change this to be downloaded from the server _DownloadWorkoutDataFileName = "DownloadWorkoutData.xml"; // temporarily get these locally. change this to be downloaded from the server _DownloadExerciseDataFileName = "DownloadExerciseData.xml"; // temporarily get these locally. change this to be downloaded from the server _FileName = "SaveData.xml"; _TrainingDataFileName = "TrainingData.xml"; _WorkoutDataFileName = "WorkoutData.xml"; _ExerciseDataFileName = "ExerciseData.xml"; _DayDataFileName = "DayData.xml"; _SettingsDataFileName = "SettingsData.xml"; _FriendDataFileName = "FriendData.xml"; myData = new SaveData(); mySettingsData = new SaveSettingsData(); }