本文整理汇总了C#中Course.GetCourseViewIDByIndex方法的典型用法代码示例。如果您正苦于以下问题:C# Course.GetCourseViewIDByIndex方法的具体用法?C# Course.GetCourseViewIDByIndex怎么用?C# Course.GetCourseViewIDByIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course.GetCourseViewIDByIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadCourseProgressData
public void LoadCourseProgressData(Course _course)
{
CourseProgressData _pData;
if (CourseProgressDataExists(_course.ID))
{
_pData = GetCourseProgressData(_course.ID);
//Debug.Log("Course Progress Data exists, let's check that it's valid and updated.");
if (_pData.GetStateDataCount() > _course.courseViews.Count)
{
Debug.LogError("Progress Data has more CV states than there are CV's. TODO: Delete them.");
}
else if (_pData.GetStateDataCount() < _course.courseViews.Count)
{
Debug.LogError("Progress Data has less CV states than there are CV's. TODO: Add them.");
}
if (!_course.CourseViewExists(_pData.GetCurrentCourseViewID()))
{
Debug.Log("Current course view doesn't exist. Setting to first one.");
_pData.SetCurrentCourseViewID( _course.GetCourseViewIDByIndex(0) );
}
}
else
{
Debug.Log("NO Course Progress Data exists: Let's set the default");
_pData = SetDefaultCourseProgressData(_course);
}
//Debug.Log("Now let's load it in!");
SetCurCourseView(_pData.GetCurrentCourseViewID());
}
示例2: SetDefaultCourseProgressData
//Optional return of default data
public CourseProgressData SetDefaultCourseProgressData(Course _course)
{
CourseProgressData _pData = new CourseProgressData(_course.ID, _course.GetCourseViewIDByIndex(0));
for (int i = 0; i < _course.courseViews.Count; i++)
{
_pData.AddStateData(new CourseViewStateData(_course.courseViews[i].ID));
}
SetCourseProgressData(_pData);
return _pData;
}