Skip to content

Commit

Permalink
Updated tutorial for clockworklabs/Blackholio#19
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutiertyler committed Feb 11, 2025
1 parent 72f4251 commit c209f02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit c209f02

Please sign in to comment.