protected void DrawFileNamePreview(System.Action drawPath, AdjustText adjustPreviewPath) { // Draw the build folder if (string.IsNullOrEmpty(previewPath) == true) { previewPath = GetPathPreview(); } string preview = previewPath; if (adjustPreviewPath != null) { preview = adjustPreviewPath(previewPath, builder); } EditorGUILayout.HelpBox(preview, MessageType.None); if (drawPath != null) { EditorGUI.BeginChangeCheck(); drawPath(); if (EditorGUI.EndChangeCheck() == true) { previewPath = null; } } }
protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken) { // Object Container: Use objectContainer.Get<T>() to retrieve objects from the scope var objectContainer = context.GetFromContext <IObjectContainer>(TextApplicationScope.ParentContainerPropertyTag); // Inputs string inputText = objectContainer.Get <string>(); // Inputs var wordsCol = Words.Get(context); var occurrencesText = Occurrences.Get(context); var occurrenceNumber = OccurrenceNumber.Get(context); var displayLog = DisplayLog; //Convert Collection to Array string[] words = Utils.ConvertCollectionToArray(wordsCol); /////////////////////////// // Add execution logic HERE string OuputString = Utils.RemoveWordsFromText(inputText, words, occurrencesText, occurrenceNumber, displayLog); /////////////////////////// // Outputs return((ctx) => { AdjustText.Set(ctx, OuputString); }); }
protected void DrawBuildFile(System.Action drawPath, AdjustText adjustPreviewPath, string foldoutLabel) { // Draw the build folder EditorUiUtility.DrawBoldFoldout(folderAnimation, foldoutLabel); using (EditorGUILayout.FadeGroupScope scope = new EditorGUILayout.FadeGroupScope(folderAnimation.faded)) { if (scope.visible == true) { DrawFileNamePreview(drawPath, adjustPreviewPath); } } }