-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
|
||
## Overview | ||
|
||
 | ||
|
||
uGameCore is a powerful framework for Unity game engine that contains core components of what every game should have. It takes care of everything 'under the hood', allowing you to focus on main parts of the game, like game logic and design. | ||
|
||
Don't ever again start from scratch, or waste your time on creating menus, settings, multiplayer... It is all done for you. You are 10 minutes away from finishing all background stuff, and finally focusing on the game itself. | ||
|
||
|
||
All features are built on top of Unity, which means it is very easy to extend them, and to adapt them to any existing project. | ||
|
||
|
||
Repository for library which is used in the project (uGameCore.dll) is [here](https://github.com/in0finite/uGameCoreLib). | ||
|
||
## Features | ||
|
||
- Player management – per player data (e.g nickname), player logins, choosing teams, spawning playing object | ||
- Teams management – every player can belong to a team (select team when joining, or change it later), or be a spectator | ||
- Map cycle – automatic map changing on time interval | ||
- Round system – round ends on time limit or on team victory, causing all players to be respawned | ||
- Spectating other players while dead | ||
- FFA – free for all mode | ||
- Scoreboard | ||
- Chat | ||
- Menu system – hierarchical organization of menus – builtin main menu, start game menu, join game menu, settings menu, pause menu, ingame menu | ||
- Cvars | ||
- Settings menu – allows to edit configuration (cvars) in a separate menu, and save/load them to playerprefs | ||
- Console – displays game log, allows commands to be entered | ||
- Console commands – can be used for server management, interaction between client and server, etc | ||
- Kill events – UI area for displaying kill events (when one player kills another) | ||
- UI for using all available features | ||
- Batch mode – support for running in batch mode (as a dedicated server) | ||
- Bunch of utility scripts | ||
- Demo scene to get you started | ||
- Extremely easy to extend | ||
- One click setup from editor menu | ||
- many others... | ||
|
||
To mention again, the framework is fully extendable. Scripts are communicating using broadcasted messages – new scripts can be added to catch these messages and change behaviour. You can detect almost any event in a game by subscribing to class events. | ||
|
||
|
||
|
||
## Download | ||
|
||
Download project as [zip archive](https://github.com/in0finite/uGameCore/archive/master.zip). Demo builds are available [here](https://drive.google.com/open?id=1cUicZgCwRhTL6TZtftThvQsAOY2oUJpR). | ||
|
||
## One click installation | ||
|
||
There is an editor menu which allows you to setup the project in one click (located at uGameCore => Setup => One click setup). | ||
|
||
So, go ahead and press that menu. If everything went fine (there are no errors or warnings in the console), | ||
then you are good to go => hit the Play button. | ||
|
||
## Manual installation | ||
|
||
If you encounter any errors or warnings during one-click setup, you should try to fix them. | ||
It's not that difficult, all possible errors and warnings are logged to console, so you can quickly see | ||
what is the problem. | ||
|
||
Anyway, these are the steps which performs one-click-setup (which you can perform manually, if the | ||
setup doesn't work): | ||
|
||
- create new scenes as copies of original startup and offline scenes | ||
|
||
- add them to build settings | ||
|
||
- add demo scenes to build settings | ||
|
||
- open newly created startup scene | ||
|
||
- create modules (prefabs) | ||
|
||
- group modules (you can use menu) | ||
|
||
- assign offline scene in NetworkManager | ||
|
||
- populate map cycle from build settings | ||
|
||
- save scene | ||
|
||
|
||
## Links | ||
|
||
- [documentation](docs/documentation.md) | ||
|
||
- [examples](docs/examples/) | ||
|
||
- [screenshots](screenshots.md) | ||
|
||
- [todo list](docs/todo.md) | ||
|
||
|
||
## Feedback | ||
|
||
If you have any questions, feel free to contact us, or post an issue. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace uGameCore.Commands { | ||
|
||
public class ChatCommands : MonoBehaviour { | ||
|
||
|
||
void Start () { | ||
|
||
string[] commands = new string[] { "say" }; | ||
|
||
foreach (var cmd in commands) { | ||
CommandManager.RegisterCommand( cmd, ProcessCommand ); | ||
} | ||
|
||
} | ||
|
||
string ProcessCommand( string command ) { | ||
|
||
// string invalidSyntaxString = "Invalid syntax."; | ||
|
||
string[] words = command.Split( " ".ToCharArray() ); | ||
int numWords = words.Length ; | ||
string restOfTheCommand = command.Substring (command.IndexOf (' ') + 1); | ||
|
||
string response = ""; | ||
|
||
if (numWords > 1 && words [0] == "say") { | ||
|
||
if (NetworkStatus.IsClientConnected ()) { | ||
|
||
var chatSync = Player.local.GetComponent<Chat.ChatSync> (); | ||
if (chatSync != null) { | ||
chatSync.CmdChatMsg (restOfTheCommand); | ||
} | ||
|
||
} else { | ||
response += "This command is only available when you are connected to server."; | ||
} | ||
|
||
} | ||
|
||
return response; | ||
} | ||
|
||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace uGameCore { | ||
|
||
public class Console2Commands : MonoBehaviour { | ||
|
||
// Use this for initialization | ||
void Start () { | ||
|
||
uGameCore.Menu.Console.onTextSubmitted += TextSubmitted; | ||
|
||
} | ||
|
||
void TextSubmitted( string text ) { | ||
|
||
// Process command | ||
string response = "" ; | ||
Commands.CommandManager.ProcessCommand( text, ref response ); | ||
|
||
if( response != "" ) | ||
Debug.Log ( response ); | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using UnityEngine; | ||
|
||
namespace uGameCore { | ||
|
||
public class ConsoleCommands : MonoBehaviour | ||
{ | ||
|
||
void Start () | ||
{ | ||
|
||
// clear the console | ||
Commands.CommandManager.RegisterCommand ("clear", (cmd) => { | ||
Menu.Console.ClearLog(); | ||
return ""; | ||
}); | ||
|
||
// display all entered commands (history) | ||
Commands.CommandManager.RegisterCommand ("history", (cmd) => { | ||
string output = ""; | ||
foreach(var historyCommand in Menu.Console.History) { | ||
output += historyCommand + "\n" ; | ||
} | ||
return output; | ||
}); | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using uGameCore.MapManagement; | ||
|
||
namespace uGameCore.Commands { | ||
|
||
public class MapCommands : MonoBehaviour { | ||
|
||
|
||
void Start () { | ||
|
||
string[] commands = new string[] { "change_scene", "list_maps", "timeleft", | ||
"nextmap" }; | ||
|
||
foreach (var cmd in commands) { | ||
CommandManager.RegisterCommand( cmd, ProcessCommand ); | ||
} | ||
|
||
} | ||
|
||
string ProcessCommand( string command ) { | ||
|
||
// string invalidSyntaxString = "Invalid syntax."; | ||
|
||
string[] words = command.Split( " ".ToCharArray() ); | ||
int numWords = words.Length ; | ||
// string restOfTheCommand = command.Substring (command.IndexOf (' ') + 1); | ||
|
||
string response = ""; | ||
|
||
// var networkManager = UnityEngine.Networking.NetworkManager.singleton; | ||
|
||
|
||
if (2 == numWords && words [0] == "change_scene") { | ||
|
||
string newSceneName = words [1]; | ||
if (NetworkStatus.IsServerStarted ()) { | ||
if (newSceneName.Length < 1) { | ||
response += "Invalid scene name."; | ||
} else { | ||
bool mapExists = MapCycle.singleton.mapCycleList.Contains (newSceneName); | ||
|
||
if (mapExists) { | ||
response += "Changing scene to " + newSceneName + "."; | ||
SceneChanger.ChangeScene (newSceneName); | ||
} else { | ||
response += "This scene does not exist."; | ||
} | ||
} | ||
} | ||
|
||
} else if (words [0] == "list_maps") { | ||
|
||
if (NetworkStatus.IsServerStarted ()) { | ||
var maps = MapCycle.singleton.mapCycleList; | ||
foreach (string mapName in maps) { | ||
response += mapName + "\n"; | ||
} | ||
} else { | ||
if (NetworkStatus.IsClientConnected ()) { | ||
// Ask server to display all available maps. | ||
Player.local.CmdListMaps (); | ||
} | ||
} | ||
|
||
} else if (words [0] == "timeleft") { | ||
|
||
if (NetworkStatus.IsServerStarted ()) { | ||
response += MapCycle.singleton.GetTimeLeftAsString (); | ||
} | ||
|
||
} else if (words [0] == "nextmap") { | ||
|
||
if (NetworkStatus.IsServerStarted ()) { | ||
response += MapCycle.singleton.GetNextMap (); | ||
} | ||
|
||
} | ||
|
||
return response; | ||
} | ||
|
||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.