<commit_before>﻿// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Microsoft.MixedReality.Toolkit.Internal.Definitions;
using Microsoft.MixedReality.Toolkit.Internal.Interfaces;
using System;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Internal.Managers
{
    public class MixedRealityManager : Utilities.Singleton<MixedRealityManager>
    {
        public MixedRealityConfigurationProfile ActiveProfile;

        #region Mixed Reality Manager Events

        public event InitialiseHandler InitializeEvent;
        public event UpdateHandler UpdateEvent;
        public event DestroyHandler DestroyEvent;
        public delegate void InitialiseHandler();
        public delegate void UpdateHandler();
        public delegate void DestroyHandler();

        #endregion

        #region Active SDK components

        [SerializeField]
        private Controller[] activeControllers;
        public Controller[] ActiveControllers
        {
            get { return activeControllers; }
            set { activeControllers = value; }
        }

        [SerializeField]
        private Headset activeHeadset;

        public Headset ActiveHeadset
        {
            get { return activeHeadset; }
            set { activeHeadset = value; }
        }

        #endregion

        protected override void InitializeInternal()
        {
            base.Awake();

            //Microsoft.MixedReality.Toolkit - Active SDK Discovery

            //Microsoft.MixedReality.Toolkit - SDK Initialization

            //Microsoft.MixedReality.Toolkit - Managers initialization

            if (ActiveProfile.EnableBoundary)
            {
                //Enable Boundary
            }

            if (ActiveProfile.EnableControllers)
            {
                //Enable Motion Controllers
            }

            if (ActiveProfile.EnableInputSystem)
            {
                //Enable Input
            }

            if (ActiveProfile.EnableFocus)
            {
                //Enable Focus
            }

            if (InitializeEvent != null) InitializeEvent.Invoke();
        }

        // Update is called once per frame
        void Update()
        {
            if (UpdateEvent != null) UpdateEvent.Invoke();
        }

        protected override void OnDestroy()
        {
            if (DestroyEvent != null) DestroyEvent.Invoke();

            //Final destroy - needs to be last
            base.OnDestroy();
        }

        #region Manager Container Management
        public void AddManager(Type type, IManager manager)<commit_msg>Moved Input system to top of manager and added initialisation example.<commit_after>﻿// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Microsoft.MixedReality.Toolkit.Internal.Definitions;
using Microsoft.MixedReality.Toolkit.Internal.Interfaces;
using System;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Internal.Managers
{
    public class MixedRealityManager : Utilities.Singleton<MixedRealityManager>
    {
        public MixedRealityConfigurationProfile ActiveProfile;

        #region Mixed Reality Manager Events

        public event InitialiseHandler InitializeEvent;
        public event UpdateHandler UpdateEvent;
        public event DestroyHandler DestroyEvent;
        public delegate void InitialiseHandler();
        public delegate void UpdateHandler();
        public delegate void DestroyHandler();

        #endregion

        #region Active SDK components

        [SerializeField]
        private Controller[] activeControllers;
        public Controller[] ActiveControllers
        {
            get { return activeControllers; }
            set { activeControllers = value; }
        }

        [SerializeField]
        private Headset activeHeadset;

        public Headset ActiveHeadset
        {
            get { return activeHeadset; }
            set { activeHeadset = value; }
        }

        #endregion

        protected override void InitializeInternal()
        {
            base.Awake();

            //Microsoft.MixedReality.Toolkit - Active SDK Discovery

            //Microsoft.MixedReality.Toolkit - SDK Initialization

            //Microsoft.MixedReality.Toolkit - Managers initialization

            if (ActiveProfile.EnableInputSystem)
            {
                //Enable Input (example initializer)
                //AddManager(typeof(InputModule.InputManager), new InputModule.InputManager());
            }

            if (ActiveProfile.EnableBoundary)
            {
                //Enable Boundary
            }

            if (ActiveProfile.EnableControllers)
            {
                //Enable Motion Controllers
            }

            if (ActiveProfile.EnableFocus)
            {
                //Enable Focus
            }

            if (InitializeEvent != null) InitializeEvent.Invoke();
        }

        // Update is called once per frame
        void Update()
        {
            if (UpdateEvent != null) UpdateEvent.Invoke();
        }

        protected override void OnDestroy()
        {
            if (DestroyEvent != null) DestroyEvent.Invoke();

            //Final destroy - needs to be last
            base.OnDestroy();
        }

        #region Manager Container Management
        public void AddManager(Type type, IManager manager)
{'fraction_non_alphanumeric': 0.06666666666666667, 'fraction_numerical': 0.0, 'mean_word_length': 1.921372031662269, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3109647', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1237, 'n_words': 360}