Versions Compared

Key

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

An example scene demonstrating how to create remove the Igloo camera from your scene during runtime.

See the example script attached to the Example GameObject for more details.

...

On the Example GameObject there is a script called IglooExample1.cs and it contains the code for destroying and re-creating the Igloo Camera System during runtime.

...

Code Block
languagec#
using UnityEngine;
using Igloo.Common;

/// <summary>
/// An Example of Creating and Destroying the Igloo Camera System
/// </summary>
public class IglooExample1 : MonoBehaviour
{
    /// <summary>
    /// Mono Start Function, Executed during the Global Start Event
    /// </summary>
    public void Start()
    {
        if (IglooManager.instance == null) Debug.LogError("<b>[Igloo]</b> Igloo Manager must be added to the Scene");
    }

    /// <summary>
    /// Create an Igloo by calling CreateIgloo() within the Igloo Manager Class
    /// </summary>
    public void CreateIgloo()
    {
        IglooManager.instance.CreateIgloo();
    }

    /// <summary>
    /// Destroy an Igloo Camera System by calling RemoveIgloo() within the Igloo Manager Class
    /// </summary>
    public void RemoveIgloo()
    {
        IglooManager.instance.RemoveIgloo();
    }

}
Info

Destroying and re-creating the Igloo camera system uses the same settings file. It will always re-create whatever camera is saved in settings.

If you are attempting to change the camera system to a diffferent one, it will need to be destroyed then have the settings altered, then re-created.

This is how the Igloo Settings Menu works in Example 6