Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By default, the Igloo Player system is enabled in the Igloo settings file. There are two 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’ 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.

Code Block
languagec#
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;
    }
}