Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated tutorial for https://github.com/clockworklabs/Blackholio/pull/19 #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/unity/part-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public partial struct Circle
public uint player_id;
public DbVector2 direction;
public float speed;
public ulong last_split_time;
public SpacetimeDB.Timestamp last_split_time;
}

[Table(Name = "food", Public = true)]
Expand Down Expand Up @@ -509,7 +509,7 @@ public class GameManager : MonoBehaviour

// If the user has a SpacetimeDB auth token stored in the Unity PlayerPrefs,
// we can use it to authenticate the connection.
if (PlayerPrefs.HasKey(AuthToken.GetTokenKey()))
if (PlayerPrefs.HasKey(AuthToken.Token != ""))
{
builder = builder.WithToken(AuthToken.Token);
}
Expand Down Expand Up @@ -548,7 +548,7 @@ public class GameManager : MonoBehaviour
}
}

private void HandleSubscriptionApplied(EventContext ctx)
private void HandleSubscriptionApplied(SubscriptionEventContext ctx)
{
Debug.Log("Subscription applied!");
OnSubscriptionApplied?.Invoke();
Expand Down
4 changes: 2 additions & 2 deletions docs/unity/part-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ public static Entity SpawnPlayerInitialCircle(ReducerContext ctx, uint player_id
);
}

public static Entity SpawnCircleAt(ReducerContext ctx, uint player_id, uint mass, DbVector2 position, DateTimeOffset timestamp)
public static Entity SpawnCircleAt(ReducerContext ctx, uint player_id, uint mass, DbVector2 position, SpacetimeDB.Timestamp timestamp)
{
var entity = ctx.Db.entity.Insert(new Entity
{
Expand All @@ -505,7 +505,7 @@ public static Entity SpawnCircleAt(ReducerContext ctx, uint player_id, uint mass
player_id = player_id,
direction = new DbVector2(0, 1),
speed = 0f,
last_split_time = (ulong)timestamp.ToUnixTimeMilliseconds(),
last_split_time = timestamp,
});
return entity;
}
Expand Down
Loading