Beamable Documentation

Welcome! Here is everything you need to get setup and become a Beamable expert.

Begin with the Getting Started section, learn more about Beamable features in the Manual, and check out the Script Reference APIs for advanced workflows.

Choose from the following...













.








.

Step 4 - Adding Content

Overview

The purpose of this guide is for game makers to add new content of an existing type provided by Beamable.

This page includes everything needed to use this feature in the "Beamable SDK for Unity". Or watch this 5 minute video.

Steps

Follow these steps to get started.

Adding Content of Existing Type

Here is the process to add a new currency.

Step

Detail

  1. Open the Content Manager Window

• Unity → Window → Beamable → Open Content Manager

  1. Expand the "Currency" Section

• Click the :arrow-down: button

  1. Add the "Currency"
• Click the :heavy-plus-sign: button • Populate the name
  1. Open the Unity Project Window

• Unity → Window → General→ Project

  1. Select the currency asset

• Search by the name given in step #3
• View the asset in the Unity Inspector Window

  1. Populate all data fields

Note: The icons can be set to any valid Unity’s Addressable object.

  1. Save the Unity Project

• Unity → File → Save Project

Best Practice: If you are working on a team, commit to version control in this step.

  1. Publish the content

• Press the "Publish" button in the Content Manager Window

Adding Content of Custom Type

In this example, the SampleContent reference is resolved using 2 different methods for sake of comparison. Production code requires only one method to be used. See ContentLink vs ContentRef for more info.

namespace DisruptorBeam.Examples.Features.ContentManager
{
  public class ContentManagerExample : MonoBehaviour
  {
    public TournamentContent TournamentContent;
    public TournamentContent TournamentContentFromLink;
    public TournamentRef Ref;
    public TournamentLink Link;
    
    protected void Start()
    {
      Ref.Resolve()
        .Then(content => { TournamentContent = content; })
        .Error(ex =>
        {
            Debug.LogError("Error!");
        });
        
      Link.Resolve()
        .Then(content => { TournamentContentFromLink = content; })
        .Error(ex =>
        {
            Debug.LogError("Error!");
        });
    }
}

[ContentType("samples")]
public class SampleContent : ContentObject
{
    public int x;
    public int y;
    public TournamentRef TournamentRef;
}

public class SampleRef : ContentRef<SampleContent> {}
public class SampleLink : ContentLink<SampleContent> {}

Advanced

Here are a few advanced configuration options and workflows.

ContentLink vs ContentRef

Beamable supports 2 methodologies for referencing a content object; ContentLink and ContentRef. Both types need to be resolved before using, but there are key differences.

  • ContentLink - Beamable will perform a First FrameFirst Frame - A first frame operation occurs *very* early in the game project's runtime -- possibly in the very first frame load to resolve the reference
  • ContentRef - Beamable will perform a LazyLazy - A lazy operation occurs on-demand at the last moment possible to satisfy the use case load to resolve the reference

📘

Best Practice

These hints make efficent use of concepts and workflows.

  • DO: Use ContentLink in any member variable in your custom content type which references another content type.
  • DON'T: Use ContentRef by default everywhere in your project. This is supported but is considered overkill.

Beamable's Custom Serialization

Some of Unity’s built-in features use Unity's serialization.

However, creating and using a custom content type relies instead on Beamable's custom SerializationSerialization - The automatic process of transforming data structures for read/write storage. This serialization is strict and has limitations.

Supported Types

Unsupported Types

• Unity’s AssetReference
• Unity’s Color
bool
double
enum
float
int
List
long
string
System.Object (and child types)
ContentRef
ContentLink

• Unity’s MonoBehaviour
• Unity’s ScriptableObject
• Etc...

Updated about a month ago


Step 4 - Adding Content


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.