public static CompletionInfo[] GetCompletions(string input) { var result = new CompletionInfo[] {}; foreach (var plugin in completionPlugins) { var completions = plugin.GetCompletions(input); if (completions != null && completions.Length > 0) { result = result.Concat(completions).ToArray(); } } return result.OrderBy(x => x.code).ToArray(); }
static public CompletionInfo[] GetCompletions(string input) { var result = new CompletionInfo[] {}; foreach (var plugin in completionPlugins) { var completions = plugin.GetCompletions(input); if (completions != null && completions.Length > 0) { result = result.Concat(completions).ToArray(); } } return(result.OrderBy(x => x.code).ToArray()); }
public override CompletionInfo[] GetCompletions(string input) { var pathCompletions = new CompletionInfo[] {}; var i1 = input.LastIndexOf("\"/"); var i2 = input.LastIndexOf("\""); if (i1 != -1 && i1 == i2) { var partialPath = input.Substring(i1 + 1); pathCompletions = allGameObjectPaths .Where(path => path.IndexOf(partialPath) == 0) .Select(path => new CompletionInfo( partialPath, path, "G", new Color32(30, 200, 80, 255))) .ToArray(); } return pathCompletions; }
public override CompletionInfo[] GetCompletions(string input) { var pathCompletions = new CompletionInfo[] { }; var i1 = input.LastIndexOf("\"/"); var i2 = input.LastIndexOf("\""); if (i1 != -1 && i1 == i2) { var partialPath = input.Substring(i1 + 1); pathCompletions = allGameObjectPaths .Where(path => path.IndexOf(partialPath) == 0) .Select(path => new CompletionInfo( partialPath, path, "G", new Color32(30, 200, 80, 255))) .ToArray(); } return(pathCompletions); }
public void SetCompletions(CompletionInfo[] completions) { Reset(); if (completions.Length == 0) return; foreach (var info in completions.Reverse()) { var itemObject = Instantiate( itemPrefab, content.position, content.rotation) as GameObject; itemObject.transform.SetParent(content); itemObject.transform.localScale = Vector3.one; var item = itemObject.GetComponent<CompletionItem>(); item.description = info.description; item.SetMark(info.mark, info.color); item.SetCompletion(info.code, info.prefix); } #if UNITY_5_2 || UNITY_5_3 || UNITY_5_4 LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent<RectTransform>()); #endif }