public void Setup(FPSCamera camera, PlayerAgent agent) { FpsCamera = camera; PlayerAgent = agent; m_origin = new GameObject("Origin").AddComponent <PlayerOrigin>(); m_origin.Setup(PlayerAgent); m_snapTurn = gameObject.AddComponent <Snapturn>(); m_snapTurn.Setup(m_origin); gameObject.AddComponent <VRWorldSpaceUI>(); m_movementVignette = gameObject.AddComponent <MovementVignette>(); m_movementVignette.Setup(agent.Locomotion, GetComponent <PostProcessingBehaviour>()); m_weaponRadial = gameObject.AddComponent <WeaponRadialMenu>(); m_weaponRadial.Setup(m_origin.transform); m_weaponAmmoHolo = gameObject.AddComponent <WeaponAmmoHologram>(); m_weaponAmmoHolo.Setup(); GameObject laserPointer = new GameObject("LaserPointer"); m_pointer = laserPointer.AddComponent <LaserPointer>(); m_fade = FpsCamera.gameObject.AddComponent <CollisionFade>(); m_fade.Setup(PlayerAgent); FpsCamera.gameObject.AddComponent <SteamVR_Camera>(); FpsCamera.gameObject.AddComponent <VRRendering>(); FpsCamera.gameObject.AddComponent <SteamVR_Fade>(); m_watch = Instantiate(VRAssets.GetWatchPrefab(), Vector3.zero, Quaternion.identity, null).AddComponent <Watch>(); m_watch.Setup(m_origin.transform); m_haptics = gameObject.AddComponent <Haptics>(); m_haptics.Setup(); m_bhapticsIntegration = gameObject.AddComponent <BhapticsIntegration>(); m_bhapticsIntegration.Setup(agent); PlayerLocomotionEvents.OnPlayerEnterLadder += PlayerEnteredLadder; SteamVR_Events.NewPosesApplied.Listen(new Action(OnNewPoses)); VRConfig.configLightResMode.SettingChanged += LightResChanged; RefreshClusteredRenderingResolution(); }
public void Setup(PlayerOrigin origin) { m_origin = origin; }