private void Update() { //Update My Avatar if (Input.GetKeyDown(KeyCode.Space)) { if (isOwnedLocally) { _RealtimeView.RequestOwnership(); } else { return; } if (!_RealtimeView.isOwnedLocally) { return; } _Index = getNewIndex(); foreach (GameObject _Player in GameObject.FindGameObjectsWithTag("Player")) { IntegerSyncScript tmpIntSyncScript = _Player.GetComponent <IntegerSyncScript>(); if (tmpIntSyncScript != this) { if (_Index == tmpIntSyncScript._Index) { _Index = getNewIndex(); } } } _integerSync.SetAvatarIndex(_Index); } //Sync All Avatars if (Input.GetKeyDown(KeyCode.Tab)) { if (!isOwnedLocally) { return; } int syncedIndex = getNewIndex(); foreach (GameObject _Player in GameObject.FindGameObjectsWithTag("Player")) { IntegerSyncScript tmpIntSyncScript = _Player.GetComponent <IntegerSyncScript>(); _Player.GetComponent <RealtimeView>().RequestOwnership(); tmpIntSyncScript._integerSync.SetAvatarIndex(syncedIndex); } } }
void Update() { // If the _float has changed (via the inspector), call SetFloat on the slider sync component. if (_value != _previousValue) { _realtimeView.RequestOwnership(); _sliderSync.SetSliderValue(_value); _previousValue = _value; text.text = _value.ToString(); } }
public virtual void _OnGrab() { tmpKinematic = insideRigidbody.isKinematic; insideRigidbody.isKinematic = makeKinematic; insideRealtime.RequestOwnership(); insideView.RequestOwnership(); grabbing = true; if (grabbedGrabbable == null) { Debug.Log("You have a grab triggered with no grab"); } else { grabbedGrabbable.GrabObject(view.ownerID, right); } OnGrab(); }
void OnCollisionEnter(Collision c) { RealtimeView rtv = c.collider.gameObject.GetComponent <RealtimeView>(); if (rtv != null) { if (rtv.isOwnedLocally == true) { rtTransform.RequestOwnership(); rtView.RequestOwnership(); transform.position = Random.insideUnitSphere + new Vector3(0, 1, 0); scorer.NewScore(); } else { print("NOT OWNED LOCALLY"); } } }
private void Update() { if (OVRInput.Get(OVRInput.Button.PrimaryHandTrigger) || OVRInput.Get(OVRInput.Button.SecondaryHandTrigger)) { _realtimeTransform.RequestOwnership(); _realtimeView.RequestOwnership(); } //while(!(OVRInput.Get(OVRInput.Button.PrimaryHandTrigger) || OVRInput.Get(OVRInput.Button.SecondaryHandTrigger))) //{ // if (OVRInput.Get(OVRInput.Button.PrimaryHandTrigger) || OVRInput.Get(OVRInput.Button.SecondaryHandTrigger)) // { // _realtimeTransform.ClearOwnership(); // _realtimeView.ClearOwnership(); // } //} if (OVRInput.Get(OVRInput.Button.One)) { _realtimeTransform.ClearOwnership(); _realtimeView.ClearOwnership(); } }
public void Grabbed() { bob.RequestOwnership(); bill.RequestOwnership(); }
// Update is called once per frame public void Grabbed() { rtTransform.RequestOwnership(); rtView.RequestOwnership(); ownership = rtTransform.ownerID; }