public void PlayState(State state, PersonDialog pd) { currentDialog = pd; if (onDialogChanged != null) { onDialogChanged.Invoke(pd); } onStateIn.Invoke(state); currentState = state; foreach (Path p in state.pathes.Where(p => p.auto)) { if (PlayerResource.Instance.CheckCondition(p.condition)) { PlayPath(p); } } if (state.pathes.Where(p => PlayerResource.Instance.CheckCondition(p.condition)).Count() == 0) { if (onFinishDialog != null) { onFinishDialog.Invoke(); } } }
private void RaycastedMissed() { if (Person) { Person = null; avaliable = true; } }
private void Raycasted(GameObject go, float distance) { if (distance > DialogDistance) { RaycastedMissed(); return; } if (!go.GetComponent <PersonDialog>()) { avaliable = true; } Person = go.GetComponent <PersonDialog>(); }
public void PlayPath(Path p) { if (p.aimState != null) { PlayState(p.aimState, currentDialog); onPathGo.Invoke(p); } else { currentDialog.playing = false; currentDialog = null; if (onDialogChanged != null) { onDialogChanged.Invoke(null); } } }
private void OnEnable() { dialog = (PersonDialog)target; dialogObject = new SerializedObject(dialog); dialogProperty = dialogObject.FindProperty("pathEvents"); }