Skip to content

Instantly share code, notes, and snippets.

@hobione2k
Created September 28, 2023 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hobione2k/3ea8d9014a4a9d9bdb87679e4dd07374 to your computer and use it in GitHub Desktop.
Save hobione2k/3ea8d9014a4a9d9bdb87679e4dd07374 to your computer and use it in GitHub Desktop.
ClusterScript Beta playerHandle重複排除
const dedupPlayer = (players) =>
players.filter((p, i) => players.findIndex((p2) => p2.id == p.id) === i);
@hobione2k
Copy link
Author

使い方

const overlapPlayers = $.getOverlaps().map((o) => o.object.playerHandle).filter((p) => p != null);
const players = dedupPlayer(overlapPlayers);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment