Hi
for personal use i would like to create a little thing to have on my phone to keep track of the hours i work.
I have a scene where i add the hours daily, the scene is a week.
Now, I have in mind to create another scene where I ask my self if i want to add a new week and visualized a list of the weeks i have already done.
the script for the week input is working ok , but i do not know how to approach the scene I am telling you about
i see i can use input field when i ask which week would you add , and have an integer for that, so i assume i can create a list called weeks of integers and that’s it
but once i input the week number what would be the process to have the scene with the weekdays and fill them up ?
I am a bit lost on that
thank you
here is the code for the weekdays in case someone wants to use it , i am adding or removing half hour each click of the buttons
private Dictionary<string, float> myWeek = new Dictionary<string, float>();
public Text monday;
public Text tuesday;
public Text wednesday;
public Text thursday;
public Text friday;
public Text saturday;
public Text sunday;
public Text total;
float TotalHours;
private void Start()
{
myWeek.Add("MON", 0);
myWeek.Add("TUE", 0);
myWeek.Add("WED", 0);
myWeek.Add("THU", 0);
myWeek.Add("FRI", 0);
myWeek.Add("SAT", 0);
myWeek.Add("SUN", 0);
}
public void AddMonday()
{
myWeek["MON"] += 0.5f;
monday.text = myWeek["MON"].ToString();
}
public void RemoveMonday()
{
myWeek["MON"] -= 0.5f;
monday.text = myWeek["MON"].ToString();
}
public void AddTuesday()
{
myWeek["TUE"] += 0.5f;
tuesday.text = myWeek["TUE"].ToString();
}
public void RemoveTuesday()
{
myWeek["TUE"] -= 0.5f;
tuesday.text = myWeek["TUE"].ToString();
}
public void AddWednesday()
{
myWeek["WED"] += 0.5f;
wednesday.text = myWeek["WED"].ToString();
}
public void RemoveWednesday()
{
myWeek["WED"] -= 0.5f;
wednesday.text = myWeek["WED"].ToString();
}
public void AddThursday()
{
myWeek["THU"] += 0.5f;
thursday.text = myWeek["THU"].ToString();
}
public void removeThursday()
{
myWeek["THU"] -= 0.5f;
thursday.text = myWeek["THU"].ToString();
}
public void AddFriday()
{
myWeek["FRI"] += 0.5f;
friday.text = myWeek["FRI"].ToString();
}
public void RemoveFriday()
{
myWeek["FRI"] -= 0.5f;
friday.text = myWeek["FRI"].ToString();
}
public void AddSaturday()
{
myWeek["SAT"] += 0.5f;
saturday.text = myWeek["SAT"].ToString();
}
public void removeSaturday()
{
myWeek["SAT"] -= 0.5f;
saturday.text = myWeek["SAT"].ToString();
}
public void AddSunday()
{
myWeek["SUN"] += 0.5f;
sunday.text = myWeek["SUN"].ToString();
}
public void RemoveSunday()
{
myWeek["SUN"] -= 0.5f;
sunday.text = myWeek["SUN"].ToString();
}
private void Update()
{
WeekTotalHours();
}
public void WeekTotalHours()
{
TotalHours = myWeek["MON"] + myWeek["TUE"] + myWeek["WED"] + myWeek["THU"] + myWeek["FRI"] +
myWeek["SAT"] + myWeek["SUN"];
total.text = TotalHours.ToString();
}
k
