Exemplo n.º 1
0
		// ============================================================================================================
		#region graph/dialogue

		/// <summary>
		/// Start a Dialogue Graph of the specified name. This will use the first graph that has the name.
		/// </summary>
		public DiaQConversation StartGraph(string byName, bool ignoreCase)
		{
			if (asset == null)
			{
				Debug.LogError("Error: DiaQ assets are not loaded.");
				return null;
			}

			DiaQGraph graph = null;
			if (ignoreCase) graph = asset.graphs.FirstOrDefault(g => g.name.Equals(byName, System.StringComparison.OrdinalIgnoreCase));
			else graph = asset.graphs.FirstOrDefault(g => g.name.Equals(byName));

			if (graph == null)
			{
				Debug.LogError(string.Format("Error: Could not find graph by name ({0}).", byName));
				return null;
			}

			activeGraph = graph;
			return activeGraph.GetData(true);
		}
Exemplo n.º 2
0
		/// <summary>
		/// Start a Dialogue Graph of the specified Ident.
		/// </summary>
		public DiaQConversation StartGraph(System.Guid byIdent)
		{
			if (asset == null)
			{
				Debug.LogError("Error: DiaQ assets are not loaded.");
				return null;
			}

			DiaQGraph graph = asset.graphs.FirstOrDefault(g => g.Ident == byIdent);

			if (graph == null)
			{
				Debug.LogError(string.Format("Error: Could not find graph by Ident ({0}).", byIdent));
				return null;
			}

			activeGraph = graph;
			return activeGraph.GetData(true);
		}