Skip to content
CoderGamesterPublic

About

This project is a the core architecture of a new mobile game project

Resources

Stars

9 stars

Watchers

1 watching

Forks

Repository files navigation

Core-Game

A Unity game template for mobile and WebGL, with constructor injection, commands, messages, statecharts, Addressables, and presenter-based UI.

Unity License: MIT

Start the sample

  1. Install Unity 6000.6.6f1 through Unity Hub, including the build modules for your target platform. The project uses URP and .NET Standard 2.1.

  2. Install Git LFS, then clone and retrieve the assets:

    git lfs install
    git clone https://github.com/CoderGamester/Core-Game.git
    cd Core-Game
    git lfs pull
  3. Open the repository root in Unity Hub with the pinned Editor. Allow Package Manager resolution, import, and compilation to finish.

  4. Open Boot and enter Play Mode. Boot opens Main, loads local configuration and UI, then enters the main menu.

Addressables settings and groups are already committed under Assets/AddressableAssetsData. Keep those settings; recreating them breaks the existing groups and addresses. The sample uses local content and does not require a backend, cloud project, or credentials. Telemetry is disabled by default, and startup does not request tracking authorization. To opt in, link your own Unity Cloud project, obtain consent and set EndUserConsent AnalyticsIntent to granted before startup, then enable analytics on the Main component.

Architecture

Owner Responsibility
Main Composition, startup, cancellation, persistence boundaries, and shutdown
StateMachines Initial loading, menu, and gameplay transitions
Logic, Commands, Data Game rules, mutations, and saved state
Services, Messages Shared operations and communication
Presenters, Views UI behavior and scene/prefab presentation
Configs, Addressables Typed configuration, UI prefabs, and content scenes

Extend the existing owners before adding abstractions. Preserve .meta GUIDs, Addressables addresses, serialized field names, and save keys when adapting the template. Renaming assemblies or presenters also requires migrating serialized type names.

Dependencies

Packages/manifest.json defines direct dependencies; Packages/packages-lock.json records their resolved graph and Git revisions. Public Git packages use release tags. Commit both files when updating dependencies and let Unity regenerate the lock file.

Package Provides
GameData Configuration, data primitives, and serialization helpers
Services Messaging, commands, persistence, pooling, and asset resolution
Statechart Hierarchical game flow
UI Service Presenters, UI loading, and URP integration
Google Sheet Importer Optional Editor-time configuration import
UniTask Asynchronous Unity operations and cancellation

Unity supplies URP, Addressables, Input System, uGUI, and the Test Framework. Configuration and data extensions are consolidated in GameData; asset importer functionality is consolidated in Services. See package documentation for their APIs rather than copying package internals into the game.

Validate and build

Close this project's interactive Editor before batch commands. Run Unity jobs serially. On macOS, the runner discovers the pinned Unity Hub installation; set UNITY_EDITOR to the Editor executable on other systems or custom installations.

Tools/validate.sh static
Tools/validate.sh compile
Tools/validate.sh editmode
Tools/validate.sh playmode
Tools/validate.sh webgl
Tools/validate.sh android
Tools/validate.sh ios

static uses Python 3 and checks the package graph, Editor pin, asset metadata, contributor wrappers, source formatting, and runtime/Editor isolation. compile imports the project and confirms compilation completed. Test commands write Unity test results. Player build commands use the committed profiles under Assets/Settings/Build Profiles through the Unity CLI; ios exports an Xcode project. Addressables content builds with the player through the committed Addressables setting. all runs the complete sequence and requires all three platform modules.

Build automation requires the Unity CLI available on your PATH; you can also use File > Build Profiles in the Editor. Compilation and tests fall back to the pinned Editor executable when the CLI is unavailable.

Logs, test results, build manifests, and player outputs have separate run directories under Artifacts/ and are excluded from Git. Review their contents: a completed command is not proof of working rendering or device behavior. WebGL requires its Hub support module and browser testing; Android requires its SDK/NDK module; iOS signing, provisioning, and device deployment happen in Xcode.

Addressables and UI

  • Edit configuration assets in Assets/Addressables/Configs. The existing UI configuration binds presenters to prefabs; keep those bindings aligned when adding screens.
  • Use Window > Asset Management > Addressables > Groups to inspect addresses, labels, and the active profile. For quick Editor iteration, use Use Asset Database play mode.
  • For a content or player build, select the intended target and use the validation runner, or build content with Build > New Build > Default Build Script in the Groups window.
  • Verify the loading screen, main menu, gameplay UI, pause/resume, save/reload, and shutdown in a visible player after changes to rendering or lifecycle behavior.

Contributing

Read AGENTS.md for architecture, asset safety, and validation requirements, and coding standards before editing source or tools. .editorconfig owns mechanical formatting and naming. Keep public integrations optional and avoid committing credentials, generated player output, or machine-specific package paths.

Report an issue. Distributed under the MIT License; dependencies retain their respective licenses.

About

This project is a the core architecture of a new mobile game project

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages