protected void Read(Stream stream, int version) { using (var reader = new BinaryReader(stream, Encoding.Default, leaveOpen: true)) { teammask = reader.ReadByte();; numPrimaryObjectives = reader.ReadInt16(); primaryObjectives = new PrimaryObjective[numPrimaryObjectives]; for (int i = 0; i < numPrimaryObjectives; i++) { var thisObjective = new PrimaryObjective(); thisObjective.id = new VU_ID(); thisObjective.id.num_ = reader.ReadUInt32(); thisObjective.id.creator_ = reader.ReadUInt32(); thisObjective.priority = new short[8]; for (int j = 0; j < 8; j++) { if ((teammask & (1 << j)) > 0) { thisObjective.priority[j] = reader.ReadInt16(); thisObjective.flags = reader.ReadByte(); } } } } }
public void LoadObjective(string key, int subObjectiveStep, int progressToLoad) { PrimaryObjective objectiveToLoad = objectivesDictionary[key]; objectiveToLoad.currentSubObjective = subObjectiveStep; objectiveToLoad.progress = progressToLoad; objectiveToLoad.ProgressChanged(); objectiveToLoad.SetGUIPanelPrefab(CreateObjectivePanel(objectiveToLoad.hasProgress, objectiveToLoad.hasSubObjectives)); objectiveToLoad.Activated(); activeObjectives.Add(objectivesDictionary[key]); }
public void RemoveActiveObjective(PrimaryObjective toRemove) { activeObjectives.Remove(toRemove); }
public void Start() { primaryObjective = GetComponentInParent <PrimaryObjective>(); }