1234567891011121314151617181920212223242526272829303132333435363738 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Events;
- namespace KairoEngine.Core
- {
- /// <summary>
- /// The main script that loads all the kairoEngine modules to the game.
- /// This is the only required script to put on one game object to start the engine.
- /// </summary>
- public class KairoEngineManager : MonoBehaviour
- {
- private static KairoEngineManager kairoEngine;
- public static KairoEngineManager instance
- {
- get {
- if(!kairoEngine)
- {
- kairoEngine = FindObjectOfType (typeof(KairoEngineManager)) as KairoEngineManager;
- if(!kairoEngine)
- {
- Debug.LogError("There need to one active KairoEngine script on the scene.");
- return null;
- }
- }
- return kairoEngine;
- }
- }
- void Awake()
- {
- if(instance != null && instance != this) Destroy(this.gameObject);
- DontDestroyOnLoad(gameObject);
- }
- }
- }
|