Beispiel #1
0
 public void Update()
 {
     //InputMgr.UpdateFrame();
     SVMMgr.UpdateFrame();
     VRMgr.UpdateFrame();
     TriggerMgr.UpdateFrame();
 }
Beispiel #2
0
 public void TriggerListener(string rType, object rData)
 {
     if (!isActiveAndEnabled)
     {
         return;
     }
     TriggerMgr.Trigger(rType, rData);
 }
Beispiel #3
0
 public void AddListener(string rMessageType, Callback <object> callback)
 {
     if (!isActiveAndEnabled)
     {
         return;
     }
     TriggerMgr.Add(rMessageType, callback);
 }
Beispiel #4
0
 void Awake()
 {
     instance = this;
     timer = GetComponent<WorldTimer>();
     noteRef = GetComponent<WorldNoteRef>();
     memory = GetComponent<Memory>();
     cardPool = GetComponent<CardPool>();
     triggerMgr = GetComponent<TriggerMgr>();
     cardCanvas = _cardCanvas;
     eventCanvas = _eventCanvas;
 }
Beispiel #5
0
 public override void OnExit()
 {
     base.OnExit();
     cameraPosition = CameraMgr.position;
     cameraRotation = CameraMgr.rotation;
     ResourceMgr.ToggleAllGameObjects(false);
     CameraMgr.UseDefaultSkybox();
     foreach (string cloneUUID in triggers)
     {
         TriggerMgr.ToggleTrigger(cloneUUID, false);
     }
 }
Beispiel #6
0
 private static void JSEditorDeleteTrigger(string _activity, string _params)
 {
     try
     {
         JSONNode root = JSON.Parse(_params);
         string   uuid = root["uuid"].Value;
         TriggerMgr.DeleteEditorSightTrigger(uuid);
         EditorMgr.RemoveTrigger(uuid);
     }
     catch (System.Exception e)
     {
         onNotify("Parse json has error: " + e.Message);
     }
 }
Beispiel #7
0
        private static void JSEditorModifyGazeIcon(string _activity, string _params)
        {
            try
            {
                JSONNode root = JSON.Parse(_params);
                string   uuid = root["uuid"].Value;
                int      icon = root["icon"].AsInt;

                TriggerMgr.ModifyGazeIcon(uuid, icon);
            }
            catch (System.Exception e)
            {
                onNotify("Parse json has error: " + e.Message);
            }
        }
Beispiel #8
0
 public override void OnEnter()
 {
     base.OnEnter();
     CameraMgr.Place(cameraPosition);
     CameraMgr.Euler(cameraRotation);
     Debug.Log(skybox);
     if (null != skybox)
     {
         CameraMgr.ApplySkybox(skybox);
     }
     ResourceMgr.ToggleGameObjects(objs.ToArray(), true);
     foreach (string cloneUUID in triggers)
     {
         TriggerMgr.ToggleTrigger(cloneUUID, true);
     }
 }
Beispiel #9
0
        private static void JSEditorFocusTrigger(string _activity, string _params)
        {
            try
            {
                JSONNode root = JSON.Parse(_params);
                string   uuid = root["uuid"].Value;
                string   type = root["type"].Value;

                if (type.Equals("sight"))
                {
                    TriggerMgr.FocusSightTrigger(uuid);
                }
            }
            catch (System.Exception e)
            {
                onNotify("Parse json has error: " + e.Message);
            }
        }
Beispiel #10
0
        private static void JSEditorModifyGazeColor(string _activity, string _params)
        {
            try
            {
                JSONNode root = JSON.Parse(_params);
                string   uuid = root["uuid"].Value;
                int      r    = root["r"].AsInt;
                int      g    = root["g"].AsInt;
                int      b    = root["b"].AsInt;
                int      a    = root["a"].AsInt;

                TriggerMgr.ModifyGazeColor(uuid, r, g, b, a);
            }
            catch (System.Exception e)
            {
                onNotify("Parse json has error: " + e.Message);
            }
        }
Beispiel #11
0
        private static void JSEditorAdjustTrigger(string _activity, string _params)
        {
            try
            {
                JSONNode root = JSON.Parse(_params);
                string   uuid = root["uuid"].Value;
                string   type = root["type"].Value;

                if (type.Equals("sight"))
                {
                    TriggerMgr.AdjustSightTrigger(uuid);
                    Vector3 position = TriggerMgr.QueryTriggerPosition(uuid);
                    Vector3 rotation = TriggerMgr.QueryTriggerRotation(uuid);
                    MessageToJS("JSOnEditorAdjustTrigger", _activity, string.Format("{{\"px\":{0}, \"py\":{1}, \"pz\":{2}, \"rx\":{3}, \"ry\":{4}, \"rz\":{5}}}", position.x, position.y, position.z, rotation.x, rotation.y, rotation.z));
                }
            }
            catch (System.Exception e)
            {
                onNotify("Parse json has error: " + e.Message);
            }
        }
Beispiel #12
0
 public override void OnDestroy()
 {
     base.OnDestroy();
     TriggerMgr.Clear();
 }
Beispiel #13
0
 private void preloadTriggerManager()
 {
     this.LogTrace("preload Trigger manager...");
     TriggerMgr.Preload();
 }