public void InitializeSequencer(HangboardProgram hangboardProgram) { programName = hangboardProgram.programName; hangTime = hangboardProgram.hangTime; restBetweenHangs = hangboardProgram.restBetweenHangs; numberOfHangs = hangboardProgram.numberOfHangs; restBetweenSets = hangboardProgram.restBetweenSets; numberOfSets = hangboardProgram.numberOfSets; hangsName = hangboardProgram.hangsName; programNameText.text = programName; numberOfHangsText.text = "1/" + numberOfHangs; numberOfSetsText.text = "1/" + numberOfSets; hangNameText.text = hangsName[0]; }
public void SaveHangboardProgram(HangboardProgram newHangboardProgram) { List <HangboardProgram> tempList = new List <HangboardProgram>(); if (dataModel.hangboardPrograms != null) { foreach (HangboardProgram o in dataModel.hangboardPrograms) { tempList.Add(o); } } tempList.Add(newHangboardProgram); dataModel.hangboardPrograms = tempList.ToArray(); SaveDataModel(dataModel); }
public void OnSubmitHangboardProgram() { string programName = hangboardForm[0].text; int restBetweenHangs = int.Parse(hangboardForm[1].text); int hangTime = int.Parse(hangboardForm[2].text); int restBetweenSets = int.Parse(hangboardForm[3].text); int numberOfHangs = int.Parse(hangboardForm[4].text); int numberOfSets = int.Parse(hangboardForm[5].text); string[] hangsName = hangboardExercicesList.ToArray(); HangboardProgram hangboardProgram = new HangboardProgram(programName, restBetweenHangs, hangTime, restBetweenSets, numberOfHangs, numberOfSets, hangsName); saveSystem.SaveHangboardProgram(hangboardProgram); addHangboardCanvas.SetActive(false); programListCanvas.SetActive(true); LoadPrograms(); }