Document toolboxDocument toolbox

Private & Confidential

v1.3 Example 3 - Player System

The Igloo Toolkit includes a player system which can be used to control the movement of the 360 camera.

Alternatively, you can also use your own player system and set the 360 camera to follow your player, however, the benefit of using the Igloo System is that it supports gyroscope-enabled devices like Igloo Touch and Steam controllers.

This makes controlling the player very intuitive while standing inside an igloo as can be seen here. https://vimeo.com/480769302

This scene shows how to configure the two methods

Igloo Player

By default, the Igloo Player system is enabled in the Igloo settings file. There are three ways to enable and disable the Igloo Player.

Method 1: Edit the IglooSettings.xml file

Open the IglooSettings.xml file found in the root of your Unity project. The file is autogenerated the first time you run Unity with the IglooManager prefab in the scene.

Set usePlayer to True/False and save.

 

 

Method 2: Enable IglooPlayer during runtime

Run the Scene, then press the ‘Follow Player' button on the ‘Example' GameObject. When the game is stopped the player settings will be saved with usePlayer enabled.

Method 3: Use the Igloo Settings Wizard

Open the Igloo Settings Wizard, by clicking the Igloo tab on the Unity Taskbar, then Settings Wizard.

Click Load to get the current active settings file.

Then open the Player Settings tab, and check the Use Player checkbox for true/false

Follow Object

The camera can also be set to not use the Igloo Player system and instead follow another object in the Scene, such as your own player system or an object on an animation path.

Assign a GameObject to the Follow Object property of the IglooManager prefab.

The IglooExample2.cs script has some code to demonstrate how to switch between the two modes during run time.

using UnityEngine; using Igloo.Common; /// <summary> /// An Example on how to use the Follow Object System within the Igloo Manager Class. /// </summary> public class IglooExample2 : MonoBehaviour { /// <summary> /// The GameObject for the Igloo Camera System to follow. If FollowObject is called. /// </summary> public GameObject followObject; /// <summary> /// Mono Start Function. Executed at Global Start /// </summary> private void Start() { if (IglooManager.instance == null) Debug.LogError("<b>[Igloo]</b> Igloo Manager must be added to the Scene"); } /// <summary> /// Follow Player Function. Turns the Igloo Player Manager on, and disables the Igloo Follow Object /// </summary> public void FollowPlayer() { IglooManager.instance.igloo.GetComponent<FollowObjectTransform>().enabled = false; IglooManager.instance.igloo.GetComponent<PlayerManager>().UsePlayer = true; } /// <summary> /// Follow Object Function. Turns the Igloo Player Manager off, and enables the Igloo Follow Object script. /// </summary> public void FollowObject() { IglooManager.instance.igloo.GetComponent<FollowObjectTransform>().enabled = true; IglooManager.instance.igloo.GetComponent<FollowObjectTransform>().followObject = followObject; IglooManager.instance.igloo.GetComponent<PlayerManager>().UsePlayer = false; } }

 

 

(c) Igloo Vision 2020