Git Product home page Git Product logo

unity-core-project's Introduction

Core Framework for Unity

Current Version 3

Supported Unity versions: 2019.1 or latest.

If you need to use the old scripting runtime (.net 3.5) then use the release-1.3 branch.

What is Core Framework?

The purpose of Core Framework is to help speed up development in Unity3D by providing the following basic systems every game needs to have:

  • Asset Bundle loading system that can load assets from:
    • Streaming assets folder
    • Web server or cloud service
    • Simulate asset bundles on editor
  • UI System
    • Basic implementation of Widgets, Dialogs and Panels
    • Transition animations by using DOTween, configurable on inspector
    • Can trigger sounds when a transition plays
  • Basic audio system
  • Mouse / Touch input control
  • Factory tool
  • Console window colors! Colorize your debug messages with colors so they are easier to read.
  • Base game starting point (Example Project)

Requirements

  • .Net 4.5.
  • .Net Standard 2.0

Demo

Example Project

Purpose

The main aspect of this library is loading and unloading asset bundles in a very simple way.

 var ball = await AssetService.LoadAsset<Ball>(AssetCategoryRoot.Prefabs,
            "Ball");

How to integrate into a project?

This project is meant to be added to an existing Unity Project, either by downloading it and placing it in the "Plugins" folder, or by setting it as a subtree to your git repo. Alternatively you can use the Example Project as a starting point.

Dependencies

Core Framework depends on the the following components

  • UniRx: And UniAsync.
  • Extenject: Core Framework libraries are loaded and used with Dependency Injectiion.
  • AssetBundles-Browser: Unity's tool for building and organizing asset bundles.
  • DOTween: Used in UI transitions.

Which platforms are compatible?

Has been tested on iOS, Android, Mac, Windows and WebGL.

Asset Bundles

For simplicity, the current asset bundle strategy for this tool is that each prefab is its own asset bundle, and asset bundles are organized by categories or directories. Image below is Unity's AssetBundles-Browser.

Asset Bundle Organization

These directories are mapped to the enum AssetCategoryRoot as shown below.

public enum AssetCategoryRoot
{
	None,
	Configuration,
	Services,
	Levels,
	SceneContent,
	GameContent,
	Windows,
	Audio,
	Prefabs
}

The service also detects the platform it's running on, and uses that to get the asset bundles from the web in the following order:

Cloud Asset Bundle Structure

This functionality is entirely seamless to the developer, thus requesting an asset is now as easy as:

   var shaterrer = await AssetService.LoadAsset<Shaterrer>(AssetCategoryRoot.Prefabs,
            Constants.Prefabs.Shaterrer);

Simulating Asset Bundles

Asset Bundle simulation is enabled by default. If you wish to disable it go to menu Core Framework -> Disable Simulate Asset Bundles.

Core Framework Preferences

Alternatively, there's also a _Core menu to enable/disable simulation mode

Core Menu

Asset Service Options

  • Use Streaming Assets
    • Toggling this will load the asset bundles from the streaming assets folder
  • Asset Bundles URL
    • Location where the asset bundles are stored on the cloud
  • Cache Asset Bundles?
    • Toggle this if you want to cache the asset bundles on device. The file UnityCloudBuildManifest.json needs to be present in order to cache bundles.

Console window colors!

This feature allows you to easily colorize debug messages so you can keep track of related events by colors on editor. This functionality is disabled on builds so the console log doesn't become cluttered with color tags.

By using the logger, device logs are not littered with tags. thus are easier to read.

Asset Service Options

   Logger.Log("My very awesome lime colored text!"",Colors.Lime);

unity-core-project's People

Contributors

nievesj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity-core-project's Issues

Pooler incorrect resizing

Is not taking in consideration the maximum allowed size and sometimes a few elements can linger beyond the allowed limit.

Research Zenject

Research Zenject and attempt to replace the Service Locator pattern with DI.

Subscription Error

On ShowOffLevel, line 36, the subscription is not doing anything, never triggers. No error display but the issue must be somewhere in uiService.OpenWindow.

Cache manifest files locally

  • Pre-load manifests locally (on device) when the game first starts. Check if they are available on each game run.
  • Only when downloading bundles and cache is enabled
  • There should be an expiration time of X days.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.