Game Logic

Game Logic Architecture

Implementing game logics is can involve highly complex decisions and depends on many circumstances such as scalability and portability. Monolithic game managers which handle all game logic internally might be easy to start but can become quickly intractable. It is important to allow flexible structures, where components can be easily connected and maintain transparency at the same time.

Unity Events

Unity Events are one great mechanic to handle actions and perpetuate the effects through out the game. Here a quick overview on events in Unity.

Scriptable Objects

Read the introduction to Three ways to architect your game with ScriptableObjects.

Unfortunately the code examples embedded to the above article are nowadays broken. You can download the article as PDF with included .cs code samples working in this ZIP package.

Copy those scripts from the ZIP into your project:

FloatVariable.cs
GameEvent.cs
GameEventListener.cs

 

Example Game Logic

Basic Unity Event

Scriptable Object Float

Game Event

Chaining Events

Trigger Volume