private void ResetVersionComponents(AssemblyVersion version, int components) { if (components > 4) { throw new ArgumentException($"AssemblyVersion has a maximum of four components, but received argument to reset {components}.", nameof(components)); } var resetComponents = new Action[] { () => version.Major = 0, () => version.Minor = 0, () => version.Build = 0, () => version.Revision = 0 }; var applicableComponents = resetComponents.Skip(4 - components); foreach (var component in applicableComponents) { component(); } }
private IEnumerator RunAction(Action action) { if (useParameters) { action.AssignValues (parameters); } else { action.AssignValues (null); } if (isSkipping) { action.Skip (); } else { if (action is ActionRunActionList) { ActionRunActionList actionRunActionList = (ActionRunActionList) action; actionRunActionList.isSkippable = IsSkippable (); } action.isRunning = false; float waitTime = action.Run (); if (action is ActionParallel) {} else if (waitTime != 0f) { while (action.isRunning) { if (this is RuntimeActionList && actionListType == ActionListType.PauseGameplay && !unfreezePauseMenus) { float endTime = Time.realtimeSinceStartup + waitTime; while (Time.realtimeSinceStartup < endTime) { yield return null; } } else { yield return new WaitForSeconds (waitTime); } if (!action.isRunning) { // In rare cases (once an actionlist is reset) isRunning may be false but this while loop will still run ResetList (); break; } waitTime = action.Run (); } } } if (action is ActionParallel) { EndActionParallel ((ActionParallel) action); } else { EndAction (action); } }
private IEnumerator RunAction (Action action) { if (useParameters) { action.AssignValues (parameters); } else { action.AssignValues (null); } if (isSkipping) { action.Skip (); } else { action.isRunning = false; float waitTime = action.Run (); if (action is ActionCheck || action is ActionCheckMultiple) { yield return new WaitForFixedUpdate (); } else if (waitTime > 0f) { while (action.isRunning) { if (this is RuntimeActionList && actionListType == ActionListType.PauseGameplay && !unfreezePauseMenus) { float endTime = Time.realtimeSinceStartup + waitTime; while (Time.realtimeSinceStartup < endTime) { yield return null; } } else { yield return new WaitForSeconds (waitTime); } waitTime = action.Run (); } } } EndAction (action); }