// Start is called before the first frame update void Start() { selfTransform = transform; act = GetComponent <BaseAct>(); agent = GetComponent <NavMeshAgent>(); agent.autoBraking = false; GotoNextPoint(); }
private BaseAct ExtractActFrom(string[] story, ref int i) { var act = new BaseAct(); MovePointerForward(story, ref i); while (!ActIsFullyExtracted(story[i])) { if (story[i].ReferTo("INTRO: ")) { act.Intro = ExtractText(story, ref i); } if (story[i].ReferTo("NAME: ")) { act.Name = SetValueFrom(story[i]); } if (story[i].ReferTo("IMAGE: ")) { act.Image = SetValueFrom(story[i]); } if (story[i].ReferTo("LOCATION: ")) { act.Location = SetLocationFrom(story[i]); } if (story[i].ReferTo("RESTRICTION: ")) { act.Restrictions.Add(ExtractRestriction(ExtractText(story, ref i))); } if (story[i].ReferTo("CHOICE:")) { var c = ExtractChoice(story, ref i); c.ParentAct = act; act.Choices.Add(c); } if (!story[i].ReferTo("CHOICE") && !story[i].ReferTo("ACT") && !story[i].ReferTo("SEQUENCE")) { MovePointerForward(story, ref i); } } return(act); }