Last active
March 22, 2024 20:16
-
-
Save hobione2k/6bd6765a8c4ec17e44352e5303c95137 to your computer and use it in GitHub Desktop.
ClusterScript Beta Overlapプレイヤーを取得
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dedupPlayer = (players) => | |
players.filter((p, i) => players.findIndex((p2) => p2.id == p.id) === i); | |
const activePlayer = (players) => | |
players.filter((p) => p != null && p.exists()); | |
const getOverlapsPlayer = () => { | |
// getOverlaps()から有効なプレイヤーだけ取得 | |
const overlaps = $.getOverlaps(); | |
const players = overlaps.map((o) => o.object.playerHandle); | |
return dedupPlayer(activePlayer(players)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment