- connection.relation.count("*")
+ connection.relation.count(:all)
puts("Hello World") |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class FloatingObject : MonoBehaviour | |
{ | |
Rigidbody rb; | |
// Linearly scales the force of buoyancy |
// Doesn't work | |
function Component(props: Props) { | |
[foo, setFoo] = useState<number>(0); | |
function useFoo() { | |
// Foo is always 0 | |
console.log(foo); | |
} | |
return <> |
function vrinstall () { | |
FILE="filename.apk" | |
device_id=$(adb devices | head -2 | tail -1 | awk '{print $1}') | |
if [ -z $device_id ] | |
then | |
echo "No device plugged in." | |
sleep 1 | |
vrinstall | |
else |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// This class is needed because RealtimeTransforms use unreliable properties, which means sometimes | |
// packets are dropped. This normally isn't a big deal, unless your app relies on a single | |
// programmatic position update. If this single update is dropped, the position of the RealtimeTransform | |
// will appear very incorrect to other users, but correct to the RealtimeTransform owner. | |
// | |
// So to fix this, after a large update we enable the Jiggle script which will jiggle the object back and forth |
set -e | |
adb shell setprop debug.oculus.capture.width 1280 | |
adb shell setprop debug.oculus.textureWidth 1280 | |
adb shell setprop debug.oculus.capture.height 720 | |
adb shell setprop debug.oculus.capture.bitrate 10000000 | |
adb shell setprop debug.oculus.foveation.level 0 | |
adb shell setprop debug.oculus.capture.fps 60 |
I had trouble finding information or examples showing how to use RealtimeDictionary, so I put together this doc that details the things I learned as I figured it out.
RealtimeDictionary isn't a generic C# dictionary that syncs across the network. It specifically maps from uint
s (unsigned ints, or integers from 0 to ~4 billion) to RealtimeModels. There are other guides which cover RealtimeModels, but they're essentially network-synced structs that can hold whatever data you like.
It's a little complicated if you were just looking to map between two primitive data types, but creating a small RealtimeModel that wraps a single attribute is pretty quick and easy.
Also note that your keys must be unsigned ints. RealtimeDictionary does not support keys of other types.
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class ExceptionManager : MonoBehaviour | |
{ | |
private const int ExceptionsPerCooldown = 5; | |
private const float CooldownTime = 5f; | |
private int _exceptionsLeftBeforeTimeout = ExceptionsPerCooldown; |