/// <summary> /// Adds empty data to an objective path. Used for creating new sub objectives. /// </summary> private void AddEmptyDataToObjectivePath() { SubObjective tempSubObjective = ScriptableObject.CreateInstance <SubObjective>(); tempSubObjective.Initialize(); nodeCanvas.objectivePaths[objectivePathIndex].objectives.Add(tempSubObjective); }
/// <summary> /// Helper function for swapping sub objectives. Used when moving objectives up and down. /// </summary> /// <param name="index">First index</param> /// <param name="newIndex">Index to swap first index to. </param> private void SwapSubObjective(int index, int newIndex) { SubObjective temp = nodeCanvas.objectivePaths[objectivePathIndex].objectives[index]; nodeCanvas.objectivePaths[objectivePathIndex].objectives[index] = nodeCanvas.objectivePaths[objectivePathIndex].objectives[newIndex]; nodeCanvas.objectivePaths[objectivePathIndex].objectives[newIndex] = temp; }
protected void SubObjectiveClear() { mainObjectiveDelayed = false; subobjectivePosition = Vector3.zero; subObjective = SubObjective.none; blockadeToDestroy = null; }