WorkTaskUnit.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using Schedule;
  3. public class WorkTaskUnit : TaskUnit
  4. {
  5. public ScheduleCSVData.Work work { get; private set; }
  6. public void SetData(ScheduleTaskViewer viewer, ScheduleTaskViewer.ViewData viewData)
  7. {
  8. base.SetData(ScheduleTaskCtrl.TaskType.Work, viewer, viewData);
  9. this.work = (ScheduleCSVData.Work)viewData.schedule;
  10. ScheduleTaskCtrl.WorkTaskButton workTaskButton = (ScheduleTaskCtrl.WorkTaskButton)viewData.taskButton;
  11. base.SetTaskRank(base.gameObject, workTaskButton.rank);
  12. base.SetExpRatio(base.gameObject, workTaskButton.expRatio);
  13. if (this.work.workTyp == ScheduleCSVData.WorkType.Basic)
  14. {
  15. base.SetTaskRank(base.gameObject, workTaskButton.rank);
  16. base.SetExpRatio(base.gameObject, workTaskButton.expRatio);
  17. base.AdjustmentTitlePos(base.gameObject, workTaskButton, true);
  18. }
  19. else if (this.work.workTyp == ScheduleCSVData.WorkType.PowerUp)
  20. {
  21. base.AdjustmentTitlePos(base.gameObject, workTaskButton, false);
  22. }
  23. }
  24. protected override void AddOnClickEvent()
  25. {
  26. EventDelegate eventDelegate = new EventDelegate(this.viewer, "OnClickTaskUnit_Work");
  27. eventDelegate.parameters[0].value = this;
  28. EventDelegate.Add(this.Button.onClick, eventDelegate);
  29. }
  30. }