{"id":22781808,"url":"https://github.com/fronkongames/gamework-foundation","last_synced_at":"2025-04-11T23:22:24.511Z","repository":{"id":41490562,"uuid":"480100044","full_name":"FronkonGames/GameWork-Foundation","owner":"FronkonGames","description":"Architecture-agnostic code and tools to make Unity based games.","archived":false,"fork":false,"pushed_at":"2024-08-20T00:49:18.000Z","size":75909,"stargazers_count":105,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T19:12:45.444Z","etag":null,"topics":["framework","game-development","game-framework","gamedev","gamedevelopment","indiedev","mit-license","u3d","unity","unity-3d","unity3d","unity3d-framework"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FronkonGames.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-10T18:09:03.000Z","updated_at":"2025-03-06T13:04:37.000Z","dependencies_parsed_at":"2023-01-18T11:00:58.945Z","dependency_job_id":"5c4850f8-52fc-4543-be6b-0f94c001e43f","html_url":"https://github.com/FronkonGames/GameWork-Foundation","commit_stats":{"total_commits":118,"total_committers":1,"mean_commits":118.0,"dds":0.0,"last_synced_commit":"33c07830df94b3192b4b46595681d42edb2191b9"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FronkonGames%2FGameWork-Foundation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FronkonGames%2FGameWork-Foundation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FronkonGames%2FGameWork-Foundation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FronkonGames%2FGameWork-Foundation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FronkonGames","download_url":"https://codeload.github.com/FronkonGames/GameWork-Foundation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493199,"owners_count":21113212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","game-development","game-framework","gamedev","gamedevelopment","indiedev","mit-license","u3d","unity","unity-3d","unity3d","unity3d-framework"],"created_at":"2024-12-11T21:08:39.628Z","updated_at":"2025-04-11T23:22:24.486Z","avatar_url":"https://github.com/FronkonGames.png","language":"C#","readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"Media/banner.png\"/\u003e\u003c/p\u003e\n\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca style=\"text-decoration:none\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/package-json/v/FronkonGames/GameWork-Foundation?style=flat-square\" alt=\"version\" /\u003e\n  \u003c/a\u003e  \n  \u003ca style=\"text-decoration:none\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/FronkonGames/GameWork-Foundation?style=flat-square\" alt=\"license\" /\u003e\n  \u003c/a\u003e\n  \u003ca style=\"text-decoration:none\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/languages/top/FronkonGames/GameWork-Foundation?style=flat-square\" alt=\"top language\" /\u003e\n  \u003c/a\u003e\n  \u003ca style=\"text-decoration:none\"\u003e\n    \u003cimg src=\"https://img.shields.io/codacy/grade/5ee510ac2f9d411583a0eb248744d75f?style=flat-square\" alt=\"code quality\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nA set of code useful for developing Unity based games. It is independent of any architecture, so you can use it together with your favorite framework.\n\nThese are the foundations on which [Game:Work Core](https://github.com/FronkonGames/GameWork-Core) is built.\n\n## 🎇 Features\n\n- Architecture agnostic, use it in any code.\n- Many [attributes](./Runtime/Attributes) to make your classes more usable in the editor. Custom [Inspector](./Editor/Inspector) to help you create your own inspectors.\n- Multiple utilities to improve your developments: [checkers](./Runtime/Development/Check), [debug draw](./Runtime/Development/Draw), [profiling](./Runtime/Development/Profiling) and a console with custom commands.\n- A lot of .Net and Unity types [extensions](./Runtime/Extensions).\n- The most used [design patterns](./Runtime/Patterns), in generic versions so that they are easy to adapt to your needs.\n- [Utilities](./Runtime/Development/Prototype/) to speed up prototyping time.\n- Commented code with test units.\n\n## 🔧 Requisites\n\n- Unity 2022.3 or higher.\n- Universal RP 14.0.11 or higher.\n- Test Framework 1.1.31 or higher.\n\n## ⚙️ Installation\n\n### Editing your 'manifest.json'\n\n- Open the manifest.json file of your Unity project.\n- In the section \"dependencies\" add:\n\n```c#\n{\n  ...\n  \"dependencies\":\n  {\n    ...\n    \"FronkonGames.GameWork.Foundation\": \"git+https://github.com/FronkonGames/GameWork-Foundation.git\"\n  }\n  ...\n}\n```\n\n### Git\n\nJust clone the repository into your Assets folder:\n\n```c#\ngit clone https://github.com/FronkonGames/GameWork-Foundation.git \n```\n\n### Zip\n\nDownload the [latest release](https://github.com/FronkonGames/GameWork-Foundation/releases) and unzip it into the Assets directory.\n\n## 🚀 Use\n\nThe functionality is divided into folders, this is its structure:\n\n```\n|\n|\\_Runtime......................... Utilities for the game.\n|   |\\_Algorithms.................. Algorithms.\n|   |    \\_Structures.............. Data structures.\n|   |\\_Attributes.................. Attributes for fields and class properties.\n|   |\\_Components.................. Components.\n|   |\\_Development................. Developer utilities.\n|   |   |\\_Check................... Assert extension.\n|   |   |\\_Console................. Development console.\n|   |   |\\_Draw.................... Utilities for drawing gameplay information.\n|   |   |\\_Profiling............... To find bottlenecks.\n|   |    \\_Prototype............... Useful components for prototypes.\n|   |\\_Extensions.................. Utility extensions.\n|   |   |\\_System.................. C# extensions.\n|   |    \\_Unity................... Unity extensions.\n|   |\\_Math........................ Mathematical utilities.\n|   |\\_Patterns.................... Design patterns.\n|   |   |\\_Behavioral.............. Behavioural patterns.\n|   |   |\\_Creational.............. Creation patterns.\n|   |    \\_Structural.............. Structure patterns.\n|    \\_Utils....................... Utilities.\n|\n|\\_Editor.......................... Editor utilities.\n|   |\\_Drawers..................... Custom attribute viewers.\n|   |\\_Fonts....................... Font for debug.\n|    \\_Inspector................... Editor appearance utilities.\n|\n|\\_Settings........................ Project settings.\n|\\_Demos........................... Demo scenes.\n|\\_Media........................... Misc resources.\n \\_Test............................ Unit tests code.\n\n```\n\nCheck the comments for each file for more information.\n\n### Attributes\n\n\u003ctable\u003e\n\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[Title(\"Attributes Demo\")]\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.title.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[MessageBox(\"MessageBox test\", MessageType.Info)]\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.messagebox.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[Label(\"Int field\")]\n[Field(50)]\npublic int intField;\n\n[Label(\"Int less than 0\")]\n[FieldLess(0, -1)]\npublic int intLess = -1;\n\n[Label(\"Int less equal than 0\")]\n[FieldLessEqual(0, 0)]\npublic int intLessEqual;\n\n[Label(\"Int greater than 0\")]\n[FieldGreat(0, 10)]\npublic int intGreater;\n\n[Label(\"Int greater equal than 10\")]\n[FieldGreat(10, 10)]\npublic int intGreaterEqual;\n\n[Label(\"Int\")]\n[Slider(0, 10, 10)]\npublic int intSlider;\n\n[Label(\"Int snap 10\")]\n[Slider(0, 100, 50, 10)]\npublic int intSnap;\n\n[Label(\"Ints min/max\")]\n[MinMaxSlider(0, 100, 0, 100)]\npublic int intMin = 0;\n\n[HideInInspector]\npublic int intMax = 100;\n\n[Label(\"Float field\")]\n[Field(1.0f)]\npublic float floatField;\n\n[Label(\"Float less than 0\")]\n[FieldLess(0.0f, -1.0f)]\npublic float floatLess = 1.0f;\n\n[Label(\"Float less equal than 0\")]\n[FieldLessEqual(0.0f, 0.0f)]\npublic float floatLessEqual;\n\n[Label(\"Float greater than 0\")]\n[FieldGreat(0.0f, 1.0f)]\npublic float floatGreater;\n\n[Label(\"Float greater equal than 0\")]\n[FieldGreatEqual(0.0f, 0.0f)]\npublic float floatGreaterEqual;\n\n[Label(\"Float\")]\n[Slider(0.0f, 1.0f, 1.0f)]\npublic float floatSlider;\n\n[Label(\"Float snap 0.5\")]\n[Slider(0.0f, 1.0f, 0.5f, 0.1f)]\npublic float floatSnap;\n\n[Label(\"Floats min/max\")]\n[MinMaxSlider(0.0f, 1.0f)]\npublic float floatMin = 0.0f;\n\n[HideInInspector]\npublic float floatMax = 1.0f;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.variables.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[Label(\"Nice name\")]\npublic string badName;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.label.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[Password]\npublic string password;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.password.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[Indent(0)]\npublic string noIndent;\n\n[Indent(1)]\npublic string indented;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.indent.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[NotNull]\npublic GameObject cantBeNull;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.notnull.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[File]\npublic string filePath;\n\n[Folder]\npublic string folderPath;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.file.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[Scene]\npublic int sceneIndex;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.scene.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[NotEditable]\npublic string notEditable;\n\n[OnlyEditableInEditor]\npublic string editableInEdit;\n\n[OnlyEditableInPlay]\npublic string editableInPlay;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.noteditable.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\npublic bool toggle;\n\n[EnableIf(nameof(toggle))]\npublic string enableIf;\n\n[DisableIf(nameof(toggle))]\npublic string disableIf;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.enableif.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\npublic bool toggle;\n\n[ShowIf(nameof(toggle))]\npublic string showIf;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.showif.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\npublic bool toggle;\n\n[HideIf(nameof(toggle))]\npublic string hideIf;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.hideif.png\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[KeyCode]\npublic KeyCode keyCode;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.keycode.gif\"/\u003e\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth align=\"left\"\u003e\n\n```c#\n[NotEditable]\npublic int counter;\n\n[Button(nameof(Increase))]\npublic string buttonInc;\n\n[Button(nameof(Reset))]\npublic string buttonReset;\n\npublic void Increase() =\u003e counter++;\npublic void Reset()    =\u003e counter = 0;\n```\n\u003c/th\u003e\u003cth\u003e\u003cimg src=\"Media/attributes.button.gif\"/\u003e\u003c/th\u003e\u003c/tr\u003e\n\n\u003c/table\u003e\n\n### Custom Inspector\n\nA simple way to create your own inspectors by quickly accessing all the private fields of your components.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"Media/inspector.png\"/\u003e\u003c/p\u003e\n\n### Check\n\nChecks the values of the variables that a function receives. If the condition is not met, **an exception is thrown**. Only active when '**UNITY_ASSERTIONS**' is defined (default only in the Editor).\n\n```c#\npublic void GetImpact(GameObject gameObject, float damage, Vector3 impact)\n{\n    Check.IsNotNull(gameObject);\n    Check.IsWithin(damage, 0.0f, 100.0f);\n    Check.Greater(impact, Vector3.zero);\n    \n    ...\n}\n```\n\nTake a look at the [Check class folder](./Runtime/Development/Check).\n\n### Draw\n\nVisualize in the Editor Scene window useful information of your game, in a simple way and without affecting the final performance of the game.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"Media/debug.draw.gif\"/\u003e\u003c/p\u003e\n\n```c#\n// Displays an array of points.\npoints.Draw();\n\n// Displays the player's direction.\nplayer.transform.Draw();\n\n// Displays the name of the GameObject.\nplayer.DrawName();\n\n// Displays RaycastHits.\nint hits = Physics.RaycastNonAlloc(playerRay, playerHits, 100.0f);\nif (hits \u003e 0)\n  playerHits.Draw(playerRay);\n```\n\n### Prototype\n\nUseful components to support the development of prototypes:\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"Media/development.components.gif\"/\u003e\u003c/p\u003e\n\n* [First person](./Runtime/Development/Prototype/FirstPersonCamera.cs), [third person](./Runtime/Development/Prototype/ThirdPersonCamera.cs) and [free](./Runtime/Development/Prototype/FreeCamera.cs) cameras.\n* [Screenshooter](./Runtime/Development/Prototype/Screenshooter.cs): asynchronous screen capture.\n* [Hardware monitor](./Runtime/Development/Prototype/HardwareMonitor.cs): shows various performance data.\n* [Collision Test](./Runtime/Development/Prototype/CollisionTest.cs): triggers events when collisions are detected.\n* [Trigger Test](./Runtime/Development/Prototype/TriggerTest.cs): triggers events.\n* [Face To](./Runtime/Development/Prototype/FaceTo.cs): orients the object so that it faces a target.\n* [Follower](./Runtime/Development/Prototype/Follower.cs): follow a target.\n* [Mover](./Runtime/Development/Prototype/Mover.cs): moves object linearly.\n* [Rotator](./Runtime/Development/Prototype/Rotator.cs): rotates an object.\n* [Material scroller](./Runtime/Development/Prototype/MaterialScroller.cs): moves a texture at a linear speed.\n\n### Development Console\n\nA developer console for executing commands.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"Media/development.console.gif\"/\u003e\u003c/p\u003e\n\nSimply add a GameObject with the [DevelopmentConsole](./Runtime/Development/Console/DevelopmentConsole.cs) component and assign the commands you want to use to it.\n\nCommands are ScriptableObjects that you can create from [DevelopmentCommand](./Runtime/Development/Console/DevelopmentCommand.cs).\nSee the commands included in [this folder](./Runtime/Development/Console/Commands/).\n\n```c#\n/// \u003csummary\u003e\n/// Quit application.\n/// \u003c/summary\u003e\n[CreateAssetMenu(fileName = \"Quit\", menuName = \"Game:Work/Development/Command/Quit\")]\npublic class QuitCommand : DevelopmentCommand\n{\n    public QuitCommand()\n    {\n      Id = \"quit\";\n      Usage = \"quit\";\n      Description = \"Quit application.\";\n    }\n\n    public override bool Execute(string[] args)\n    {\n        Application.Quit();\n    \n        return true;\n    }\n}\n```\n\n### Profiling\n\nIt measures in a simple way the time it takes for a block of code to execute, or the memory it consumes.\n\n```c#\nusing (Profiling.Time(\"Some slow code\"))\n{\n    ...\n}\n```\n\nOutput the message: \"**Task 'Some slow code' took 27.66ms (0 frames)**\"\n\n```c#\nusing (Profiling.Memory(\"Some hungry code\"))\n{\n    ...\n}\n```\n\nOutput the message: \"**Task 'Some hungry code' consume 4.00 kb**\". \n\n### Algorithms\n\nAlgorithms and data structures.\n\n- Structures: [ArrayList](./Runtime/Algorithms/Structures/ArrayList.cs).\n\n### Patterns\n\nThe most used design patterns:\n\n- Behavioral: [Command](./Runtime/Patterns/Behavioral/Command), [Observer](./Runtime/Patterns/Behavioral/Observer), [Strategy](./Runtime/Patterns/Behavioral/Strategy), [Visitor](./Runtime/Patterns/Behavioral/Visitor), [State](./Runtime/Patterns/Behavioral/State).\n- Creational: [Service Locator](./Runtime/Patterns/Creational/ServiceLocator/), [Singleton](./Runtime/Patterns/Creational/Singleton).\n- Structural: [Decorator](./Runtime/Patterns/Structural/Decorator).\n\nAll using generics.\n\n### Unit tests\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"Media/unittests.png\"/\u003e\u003c/p\u003e\n\n## 📜 License\n\nCode released under [MIT License](https://github.com/FronkonGames/GameWork-Foundation/blob/main/LICENSE.md).\n\n'[Prototype Asset Pack](https://assethunts.itch.io/prototype)' by [AssetHunts](https://assethunts.itch.io/).\n\n'[Prototype Textures](https://www.kenney.nl/assets/prototype-textures)' and '[Mannequin Character Pack](https://assethunts.itch.io/mannequinfree)' by [AssetHunts](https://assethunts.itch.io/).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffronkongames%2Fgamework-foundation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffronkongames%2Fgamework-foundation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffronkongames%2Fgamework-foundation/lists"}