Document toolboxDocument toolbox

Private & Confidential

v1.3 Example 4 - Scripting Setup

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

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.

The Igloo Example gameObject
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(); } }

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

(c) Igloo Vision 2020