コード例 #1
0
    private IEnumerator WaitForInit()
    {
        MEHoloEntrance entrance = MEHoloEntrance.Instance;

        while (!entrance.HasInit)
        {
            yield return(null);
        }

        collaborationManager = CollaborationManager.Instance;

        collaborationManager.AddMessageHandler(this);

        MsgEntry entry = new MsgEntry();

        entry.ShowId = "Test";
        GetTransformFloat(cube.transform, entry);

        ShowObject  showObject = new ShowObject(entry);
        SceneObject roomData   = new SceneObject();

        roomData.ShowObjectDic.Add(showObject.ShowId, showObject);

        collaborationManager.roomInitData = roomData;

        collaborationManager.TurnOn();
    }
コード例 #2
0
    /// <summary>
    /// initialization of modules and variables
    /// </summary>
    /// <returns></returns>
    private IEnumerator WaitForInit()
    {
        MEHoloEntrance entrance = MEHoloEntrance.Instance;

        while (!entrance.HasInit)
        {
            yield return(null);
        }

        //instantiate elements
        inputManager           = MultiInputManager.Instance;
        inputManager.layerMask = LayerMask.GetMask("Default") | LayerMask.GetMask("UI");
        inputManager.cbTap    += OnTap;
        //collaboration module
        collaborationManager = CollaborationManager.Instance;
        collaborationManager.AddMessageHandler(this);
        collaborationManager.cbEnterRoom = cbEnterRoom;
        //cursor module
        cursor = UIManager.Instance.cursorController;

        //it is possible to use more than message.
        //bear in mind that messages must have different id so
        string   showId = "showId001";
        MsgEntry msg    = new MsgEntry();

        msg.ShowId = showId;
        showObject = new ShowObject(msg);
        roomData   = new SceneObject();
        roomData.ShowObjectDic.Add(showObject.ShowId, showObject);

        collaborationManager.roomInitData = roomData;
        collaborationManager.TurnOn();
    }
コード例 #3
0
        /// <summary>
        /// 初始化系统
        /// </summary>
        private void InitSystem()
        {
            accountManager = AccountManager.Instance;
#if true // UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA
            anchorController = SceneAnchorController.Instance;
#endif
            liveController       = LiveController.Instance;
            inputManager         = MultiInputManager.Instance;
            speechManager        = SpeechManager.Instance;
            uiManager            = UIManager.Instance;
            collaborationManager = CollaborationManager.Instance;
            libraryManager       = LibraryManager.Instance;

            moduleSwitch.Add(NeedAccount);
#if true // UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA
            moduleSwitch.Add(NeedAnchor);
#endif
            moduleSwitch.Add(NeedInput);
            moduleSwitch.Add(NeedSpeech);
            moduleSwitch.Add(NeedUI);
            moduleSwitch.Add(NeedCollaboration);
            moduleSwitch.Add(NeedLibrary);
            moduleSwitch.Add(NeedLive);

            moduleList.Add(accountManager);
#if true // UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA
            moduleList.Add(anchorController);
#endif
            moduleList.Add(inputManager);
            moduleList.Add(speechManager);
            moduleList.Add(uiManager);
            moduleList.Add(collaborationManager);
            moduleList.Add(libraryManager);
            moduleList.Add(liveController);

            // 按需求启动模块
            for (int i = 0; i < moduleSwitch.Count; i++)
            {
                if (moduleList[i] == null)
                {
                    continue;
                }

                if (moduleSwitch[i])
                {
                    moduleList[i].gameObject.SetActive(true);
                    moduleList[i].Init();
                }
                else
                {
                    moduleList[i].gameObject.SetActive(false);
                }
            }

            // 初始化系统菜单
            InitSystemMenu();

            HasInit = true;
        }
コード例 #4
0
        /// <summary>
        /// 初始化系统
        /// </summary>
        private void InitSystem()
        {
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA
            anchorController = SceneAnchorController.Instance;
#endif
            liveController       = LiveController.Instance;
            inputManager         = MultiInputManager.Instance;
            speechManager        = SpeechManager.Instance;
            uiManager            = UIManager.Instance;
            collaborationManager = CollaborationManager.Instance;
            storageManager       = StorageManager.Instance;

            mrc = MixedRealityCapture.Instance;
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA
            moduleSwitch.Add(NeedAnchor);
#endif
            moduleSwitch.Add(NeedInput);
            moduleSwitch.Add(NeedSpeech);
            moduleSwitch.Add(NeedUI);
            moduleSwitch.Add(NeedCollaboration);
            moduleSwitch.Add(NeedStorage);
            moduleSwitch.Add(NeedSocial);
            moduleSwitch.Add(NeedLive);
#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_WSA
            moduleList.Add(anchorController);
#endif
            moduleList.Add(inputManager);
            moduleList.Add(speechManager);
            moduleList.Add(uiManager);
            moduleList.Add(collaborationManager);
            moduleList.Add(storageManager);
            moduleList.Add(mrc);
            moduleList.Add(liveController);

            // 按需求启动模块
            for (int i = 0; i < moduleSwitch.Count; i++)
            {
                if (moduleList[i] == null)
                {
                    continue;
                }

                if (moduleSwitch[i])
                {
                    moduleList[i].gameObject.SetActive(true);
                    moduleList[i].Init();
                }
                else
                {
                    moduleList[i].gameObject.SetActive(false);
                }
            }

            HasInit = true;
        }
コード例 #5
0
    private IEnumerator WaitForInit()
    {
        MEHoloEntrance entrance = MEHoloEntrance.Instance;

        while (!entrance.HasInit)
        {
            yield return(null);
        }
        cm = CollaborationManager.Instance;
        cm.AddMessageHandler(this);
        initShowObject();
        cm.TurnOn();
    }
コード例 #6
0
        private IEnumerator WaitForInit()
        {
            MEHoloEntrance entrance = MEHoloEntrance.Instance;

            while (!entrance.HasInit)
            {
                yield return(null);
            }

            cursor = UIManager.Instance.cursorController;


            // Todo: Begin your logic
            inputManager        = MultiInputManager.Instance;
            inputManager.cbTap += OnTap;

            cm = CollaborationManager.Instance;
            cm.AddMessageHandler(this);
            cm.cbEnterRoom = cbEnterRoom;

            string showId   = "showId001";
            string obj_type = "ColorType";

            MsgEntry msg = new MsgEntry();

            msg.ShowId = showId;

            ObjectInfo info = new ObjectInfo();

            info.ObjType = obj_type;
            msg.Info     = info;

            msg.Vec.Add((long)CurrentColor);

            showObject = new ShowObject(msg);
            roomData   = new SceneObject();
            roomData.ShowObjectDic.Add(showObject.ShowId, showObject);

            cm.roomInitData = roomData;
            cm.TurnOn();
        }
コード例 #7
0
    public void Init()
    {
        cv_selected        = selectedContainer.gameObject.GetComponent <ContainerView>();
        cv_originContainer = originContainer.gameObject.GetComponent <ContainerView>();

        cv_selected.containerType        = ContainerView.ContainerType.SelectedContainer;
        cv_originContainer.containerType = ContainerView.ContainerType.OriginContainer;


        //selectedPlanet = new PlanetObject();
        selectedPlanet = planetObject_notSelected;

        gazeManager = MultiInputManager.Instance;

        if (expControl != null)
        {
            expControl.Init();
        }

        cm = CollaborationManager.Instance;
        cm.AddMessageHandler(this);
    }
コード例 #8
0
    /// <summary>
    /// used for initialization of variable and modules
    /// </summary>
    /// <returns></returns>
    private IEnumerator WaitForInit()
    {
        MEHoloEntrance entrance = MEHoloEntrance.Instance;

        while (!entrance.HasInit)
        {
            yield return(null);
        }
        //instantiate modules
        inputManager = MultiInputManager.Instance;
        cm           = CollaborationManager.Instance;
        uiManager    = UIManager.Instance;

        // Todo: Begin your logic
        inputManager.cbTap += OnTap;
        cm.AddMessageHandler(this);
        cm.cbEnterRoom = cbEnterRoom;

        string showId   = "showId001";
        string obj_type = "name";

        string showId2 = "showId002";

        //creation of a message entry
        MsgEntry msg = new MsgEntry();

        msg.ShowId = showId;
        ObjectInfo info = new ObjectInfo();

        info.ObjType = obj_type;
        msg.Info     = info;
        //add position of the main camera
        msg.Pr.Add(mainCamera.transform.position.x);
        msg.Pr.Add(mainCamera.transform.position.y);
        msg.Pr.Add(mainCamera.transform.position.z);
        //add three other elements to Pr to
        //reserve position for the focused object
        msg.Pr.Add(0);
        msg.Pr.Add(0);
        msg.Pr.Add(0);
        showObject = new ShowObject(msg);
        roomData   = new SceneObject();
        roomData.ShowObjectDic.Add(showObject.ShowId, showObject);

        cm.roomInitData = roomData;
        cm.TurnOn();

        //UI module
        menu = uiManager.menuManager.GetMenu("Menu");
        menu.transform.position           = mainCamera.transform.forward;
        uiManager.menuManager.cbMenuHide += OnMenuHide;
        //register action for the elements of the Menu
        menu.RegistButtonClick("button1.a", ShowAction);
        menu.RegistButtonClick("button1.b", HideAction);
        menu.RegistButtonClick("button2", DeleteLines);
        menu.RegistButtonClick("button2.b", DeleteJsonAction);
        menu.RegistButtonClick("button3", LoadAction);
        menu.RegistButtonClick("button4", SaveAction);


        inputManager.layerMask = LayerMask.GetMask("Engine") | LayerMask.GetMask("UI");
    }