Пример #1
0
 public override void OnStartAuthority()
 {
     trackedController  = GameObject.Find(string.Format("Controller ({0})", HandSide.ToString("G").ToLowerInvariant()));
     transform.position = trackedController.transform.position;
     transform.rotation = trackedController.transform.rotation;
     transform.parent   = trackedController.transform;
     steamDevice        = SteamVR_Controller.Input((int)trackedController.GetComponent <SteamVR_TrackedObject>().index);
     CmdSpawnTool(HandSide);
 }
Пример #2
0
    public override void OnStartAuthority()
    {
        // attach the controller model to the tracked controller object on the local client
        if (hasAuthority)
        {
            trackedController = GameObject.Find(string.Format("Controller ({0})", side.ToString("G").ToLowerInvariant()));

            Helper.AttachAtGrip(trackedController.transform, transform);

            localPlayer = ClientScene.FindLocalObject(ownerId).GetComponent <VRPlayerController> ();

            steamDevice = SteamVR_Controller.Input((int)trackedController.GetComponent <SteamVR_TrackedObject>().index);
        }
    }
Пример #3
0
    public override void OnStartAuthority()
    {
        // attach the controller model to the tracked controller object on the local client
        if (hasAuthority)
        {
            trackedController = GameObject.Find(string.Format("Controller ({0})", side.ToString("G").ToLowerInvariant()));

            //Helper.AttachAtGrip(trackedController.transform, transform);
            gameObject.GetComponent <F_CopyXForms>().target = trackedController.transform;

            localPlayer = NetworkIdentity.spawned[ownerId].GetComponent <VRPlayerController>();

            steamDevice = SteamVR_Controller.Input((int)trackedController.GetComponent <SteamVR_TrackedObject>().index);
        }
    }