Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Updated sponsoring info #302

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Package/Documentation/Introduction/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# FAQ

## How can I support this project?

The best way to support this project is to use it, and provide feedback. If you find a bug, or have a feature request, please create an issue on the [GitHub repository](https://github.com/crashkonijn/GOAP). Making your own contributions is also a great way to support the project. This can be done by creating a pull request on the [GitHub repository](https://github.com/crashkonijn/GOAP).

If you want to support the project financially, you can do so by donating to the [GitHub Sponsor](https://github.com/sponsors/crashkonijn) page or by buying the [Support Edition](https://assetstore.unity.com/packages/slug/298995) on the Unity Asset Store.

## Why does each action need a target?

Unless you're creating a 0 dimension game, there are actions that take place at a specific position. When there are actions that require positions there a 3 possible solutions for handling the movement.
Expand All @@ -16,4 +22,4 @@ This does make the graph much smaller. However each action would require logic f

This is the option this project uses. This uses a smaller graph than option 1. This doesn't need to perform movement in an action, keeping them simpler. The graph calculates distance between two actions, adding that cost automatically. Actions don't need to be aware of each other, or their relative position in the graph, making them simpler.

![With move actions](../images/faq\_target\_with\_move\_actions.png) ![Without move actions](../images/faq\_target\_without\_move\_action.png)
![With move actions](../images/faq\_target\_with\_move\_actions.png) ![Without move actions](../images/faq\_target\_without\_move\_action.png)
66 changes: 38 additions & 28 deletions Package/Editor/CrashKonijn.Goap.Editor/About/AboutEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,96 +10,106 @@ namespace CrashKonijn.Goap.Editor
public class AboutEditorWindow : EditorWindow
{
private const int Version = 1;

private static string goapSource = "loading";
private static string goapVersion = "loading";
private static string collectionsVersion = "loading";

private static ListRequest request;
private static AboutEditorWindow instance;

[MenuItem("Tools/GOAP/About")]
private static void ShowWindow()
{
var window = GetWindow<AboutEditorWindow>();
window.titleContent = new GUIContent("GOAP (About)");
window.Show();

instance = window;

CheckProgress();

EditorApplication.update += CheckProgress;
}

private void OnFocus()
{
instance = GetWindow<AboutEditorWindow>();

CheckProgress();
this.Render();
}

private void Render()
{
this.rootVisualElement.Clear();

var styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>($"{GoapEditorSettings.BasePath}/Styles/Generic.uss");
this.rootVisualElement.styleSheets.Add(styleSheet);

styleSheet = AssetDatabase.LoadAssetAtPath<StyleSheet>($"{GoapEditorSettings.BasePath}/Styles/About.uss");
this.rootVisualElement.styleSheets.Add(styleSheet);

// Add image
this.rootVisualElement.Add(new Image
{
image = AssetDatabase.LoadAssetAtPath<Texture2D>(GoapEditorSettings.BasePath + "/Textures/goap_header.png")
image = AssetDatabase.LoadAssetAtPath<Texture2D>(GoapEditorSettings.BasePath + "/Textures/goap_header.png"),
});

var scrollView = new ScrollView();
scrollView.verticalScrollerVisibility = ScrollerVisibility.Auto;

scrollView.Add(new Card((card) =>
{
card.Add(new Label(this.GetText())
{
style =
{
whiteSpace = WhiteSpace.Normal,
overflow = Overflow.Hidden
}
overflow = Overflow.Hidden,
},
});
}));

scrollView.Add(new Card((card) =>
{
card.Add(new Label(this.GetDebugText()));

this.AddButtons(card);
}));

scrollView.Add(new Card((card) =>
{
card.Add(new Label("Links"));

this.AddLink(card, "Documentation", "https://goap.crashkonijn.com");
this.AddLink(card, "Discord", "https://discord.gg/dCPnHaYNrm");
this.AddLink(card, "Asset Store", "https://assetstore.unity.com/packages/slug/252687");
this.AddLink(card, "GitHub", "https://github.com/crashkonijn/GOAP");

this.AddLink(card, "Tutorials", "https://www.youtube.com/playlist?list=PLZWmMt_TbeYeatHa9hntDPu4zGEBAFffn");
this.AddLink(card, "General References", "https://www.youtube.com/playlist?list=PLZWmMt_TbeYdBZKvlsRuuOubPTTfPuZot");
}));


scrollView.Add(new Card((card) =>
{
card.Add(new Label("Sponsor the project"));

this.AddLink(card, "GitHub Sponsors", "https://github.com/sponsors/crashkonijn");
this.AddLink(card, "Support Edition", "https://assetstore.unity.com/packages/slug/298995");
}));

this.rootVisualElement.Add(scrollView);
}

private void AddLink(VisualElement parent, string text, string url)
{
parent.Add(new Button(() =>
{
Application.OpenURL(url);
})
{
text = text
text = text,
});
}

Expand All @@ -109,18 +119,18 @@ private void AddButtons(Card card)
{
card.Add(new Button(CheckProgress)
{
text = "Refresh"
text = "Refresh",
});

return;
}

card.Add(new Button(this.CopyDebug)
{
text = "Copy debug to Clipboard"
text = "Copy debug to Clipboard",
});
}

private string GetDebugText()
{
return @$"GOAP Version: {goapVersion} ({goapSource})
Expand All @@ -143,15 +153,15 @@ public void CopyDebug()
{
EditorGUIUtility.systemCopyBuffer = this.GetDebugText();
}

private static void CheckProgress()
{
if (request == null)
request = Client.List();

if (!request.IsCompleted)
return;

EditorApplication.update -= CheckProgress;

goapSource = request.Result.Any(x => x.name == "com.crashkonijn.goap") ? "Git" : "Asset Store";
Expand All @@ -161,4 +171,4 @@ private static void CheckProgress()
instance.Render();
}
}
}
}
Binary file modified Package/Editor/CrashKonijn.Goap.Editor/Textures/goap_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Visualize your GOAP nodes and their interactions with our intuitive Node Viewer.
- **Documentation**: Access comprehensive guides and API references in the `Package/Documentation` folder or visit [goap.crashkonijn.com](https://goap.crashkonijn.com/).
- **Demos**: Explore practical implementations in the Demo folder. Simply clone this repository and open the Demo project in Unity to get started.

## Sponsoring
If you'd like to sponsor the project, this can be done through my [GitHub Sponsor](https://github.com/sponsors/crashkonijn) page or by buying the [Support Edition](https://assetstore.unity.com/packages/slug/298995) on the Unity Asset Store.

## References
- **[YouTube tutorials](https://www.youtube.com/playlist?list=PLZWmMt_TbeYeatHa9hntDPu4zGEBAFffn)** on how to use the library.
- **[YouTube references](https://www.youtube.com/playlist?list=PLZWmMt_TbeYdBZKvlsRuuOubPTTfPuZot)** discussing GOAP in general.
Expand Down
Loading