本文整理汇总了C#中Task.IsTaskCompleted方法的典型用法代码示例。如果您正苦于以下问题:C# Task.IsTaskCompleted方法的具体用法?C# Task.IsTaskCompleted怎么用?C# Task.IsTaskCompleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task.IsTaskCompleted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildAndLoadPrison
// Loads the entire Prison with a certain level
public void BuildAndLoadPrison()
{
Debug.Log("BuildAndLoadPrison");
string PrisonLevelLabel = "P" + PrisonSelected + "_L" + LevelSelected + "_";
List<Phase> LevelPhases = new List<Phase>();
bool FoundCurrentTask = false;
for(int i = 1; i < 5; i++) // 4 phases in each level
{
int taskInPhase = LevelTracker.GetNumberOfTasksInPhase (PrisonLevelLabel + "PH" + i + "_TN"); // Get # tasks in phase
List<Task> Tasks = new List<Task>();
for (int j = 1; j < taskInPhase + 1; j++)
{
Task TaskToCheck = new Task(PrisonSelected, LevelSelected, i, j);
if(!TaskToCheck.IsTaskCompleted() && !FoundCurrentTask)
{
CurrentTask = TaskToCheck;
FoundCurrentTask = true;
}
Tasks.Add(TaskToCheck);
}
LevelPhases.Add (new Phase(PrisonSelected, LevelSelected, i, Tasks));
}
Level Level = new Level(PrisonSelected, LevelSelected, LevelPhases);
CurrentLevel = Level;
List<Level> Levels = new List<Level>();
Prison Prison = new Prison(PrisonSelected, Levels);
CurrentPrison = Prison;
GameManager.ObjectiveScreen.ResetAll();
// Signal the Task Tracker that everything is ready for action
GameManager.TaskTracker.Initialize();
}
示例2: TrackTaskProgress
/*This method will automatically save a Tasks progress in PlayerPrefs - is used for when the task is completed or incomplete*/
public static void TrackTaskProgress(Task TaskInProgress)
{
//get level/prison/task from level builder
//task completed
string Label = "P" + TaskInProgress.GetPrison() + "_" +
"L" + TaskInProgress.GetLevel() + "_" +
"PH" + TaskInProgress.GetPhase() + "_" +
"T" + TaskInProgress.GetOrder();
int Progress = TaskInProgress.IsTaskCompleted() ? 1 : 0;
PlayerPrefs.GetInt (Label);
PlayerPrefs.SetInt(Label, Progress);
}