This file contains hidden or 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
<?xml version="1.0"?> | |
<Alias targetDevice1="Logicool G GUB G923 Racing Wheel for PlayStation 4 and PC (USB)" | |
targetDevice2="Logitech G923 TRUEFORCE Racing Wheel PS" | |
targetProductGuid="{C266046D-0000-0000-0000-504944564944}"> | |
<Axis axis="x" name="Steering" /> | |
<Axis axis="y" name="Gas" /> | |
<Axis axis="rz" name="Brake" /> | |
<Axis axis="slider:0" name="Clutch" /> | |
<Button number="1" name="X" /> | |
<Button number="2" name="Square" /> |
This file contains hidden or 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
// エリアに入ったプレイヤーにグループを設定するやつ // | |
// こちらの記事のサンプルのMixerプレハブが必須 | |
// https://creator.cluster.mu/2025/04/14/voicevolumerateof-sample/ | |
// OverlapDetectorShapeコンポーネントが必要 | |
const DEFAULT_GROUP = 0; // デフォルトのグループ | |
// groupIDを取得 | |
const getGroupId = () => $.getStateCompat("this", "group", "integer"); | |
// getOverlaps()からPlayerHandleをまとめて取得 |
This file contains hidden or 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
using UnityEngine; | |
using UnityEditor; | |
using System.Collections.Generic; | |
using System.Linq; | |
using VRC.SDKBase; | |
using UnityEngine.SceneManagement; | |
#if UNITY_EDITOR | |
public class ToggleAvatar : EditorWindow |
This file contains hidden or 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
from decimal import Decimal, getcontext | |
from fractions import Fraction | |
from typing import Iterable, List | |
getcontext().prec = 4 * 8 | |
def continued_fraction(n) -> Fraction: | |
if len(n) == 1: | |
return Fraction(n[0]) | |
else: |
This file contains hidden or 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 logLvl = () => $.getStateCompat(Tg.this, "LOG_LEVEL", T.integer); | |
const pd = (n, l = 2) => { | |
return n.toString().padStart(l, "0"); | |
}; | |
const now = () => { | |
const d = new Date(); | |
const time = `${pd(d.getHours())}:${pd(d.getMinutes())}:${pd( | |
d.getSeconds() | |
)}.${pd(d.getMilliseconds(), 3)}`; | |
return time; |
This file contains hidden or 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 rad2Deg = (r) => (r * 180) / Math.PI; | |
const aimAt = (pos, target) => { | |
const dir = target.clone().sub(pos); | |
const angleY = rad2Deg(Math.atan2(dir.x, dir.z)); // Y軸回転 | |
const d = new Vector2(dir.x, dir.z).length(); | |
const angleX = -rad2Deg(Math.atan2(dir.y, d)); // X軸回転 | |
return new Quaternion().setFromEulerAngles(new Vector3(angleX, angleY, 0)); | |
}; |
This file contains hidden or 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 sendAll = (items, type, value) => { | |
if (items == null) return; | |
items = items.concat(); | |
while (items.length > 0) { // 送信先があれば実行 | |
const item = items.shift(); // 取り出す | |
try { | |
item.send(type, value); | |
} catch (e) { | |
items.unshift(item); // エラーになったら戻して次回に回す | |
return items; |
This file contains hidden or 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 activePlayer = (players) => | |
players.filter((p) => p != null && p.exists()); | |
const getAllPlayer = () => { | |
const players = $.getPlayersNear($.getPosition(), Infinity); | |
return activePlayer(players); | |
} |
This file contains hidden or 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
// インタラクトしたユーザーの頭にアイテムをくっつける | |
// ※アイテムスケールが1であること | |
$.onInteract((player) => { | |
$.state.targetPlayer = player; | |
}); | |
const attachSubNodeToPlayer = (subNode, player, bone, offset) => { | |
const bonePos = player.getHumanoidBonePosition(bone); | |
const boneRot = player.getHumanoidBoneRotation(bone); | |
const globalPos = bonePos.add(offset.clone().applyQuaternion(boneRot)); |
This file contains hidden or 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
// インタラクトしたユーザーの頭にアイテムをくっつける | |
$.onInteract((player) => { | |
$.state.targetPlayer = player; | |
}); | |
const attachToPlayer = (player, bone, offset) => { | |
const bonePosition = player.getHumanoidBonePosition(bone); | |
const boneRotation = player.getHumanoidBoneRotation(bone); | |
const position = bonePosition.add(offset.clone().applyQuaternion(boneRotation)); | |
$.setPosition(position); |
NewerOlder