Beispiel #1
0
        public void initKeywordsWithRooms()
        {
            keywords2 = new Dictionary <string, System.Action>();
            var keylist = sman.linkcloudctrl.GetKeywordKeys();
            int nadded  = 0;

            foreach (var key in keylist)
            {
                var val = sman.linkcloudctrl.GetKeywordValue(key);
                keywords2.Add(key, () => { sman.NodeAction(val); });
                nadded += 1;
                RegionMan.Log("Adding key:" + key + "  Val:" + val);
            }
            if (kR2 != null)
            {
                kR2.Stop();
                kR2.Dispose();
                kR2 = null;
            }
            if (keywords2.Count > 0)
            {
                kR2 = new KeywordRecognizer(keywords2.Keys.ToArray());
                kR2.OnPhraseRecognized += kROnPhraseRecognized2;
                kR2.Start();
            }
            RegionMan.Log("keywords rooms num keys:" + keywords2.Count);
        }
Beispiel #2
0
 // Use this for initialization
 void initKeywords()
 {
     keywords1 = new Dictionary <string, System.Action>();
     addStandardKeywords(keywords1);
     kR1 = new KeywordRecognizer(keywords1.Keys.ToArray());
     kR1.OnPhraseRecognized += kROnPhraseRecognized;
     kR1.Start();
     RegionMan.Log("keywords1 started num keys:" + keywords1.Count);
 }
Beispiel #3
0
        public void ChangeSpatialDetail(int val)
        {
            var smgo = GetSpatialMapper();
            var smr  = smgo.GetComponent <UnityEngine.XR.WSA.SpatialMappingRenderer>();

            var lod    = smr.lodType;
            var newlod = NextLodVal(lod, val);

            smr.lodType = newlod;
            RegionMan.Log("Spatial Mapping Lod Changed old:" + lod + "  new:" + newlod);
            Debug.Log("Spatial Mapping Lod Changed old:" + lod + "  new:" + newlod);
        }
Beispiel #4
0
        public void ChangeSpatialExtent(float val)
        {
            var smgo = GetSpatialMapper();
            var smr  = smgo.GetComponent <UnityEngine.XR.WSA.SpatialMappingRenderer>();

            var hbe    = smr.halfBoxExtents;
            var newhbe = hbe + new Vector3(val, val, val);

            smr.halfBoxExtents = newhbe;
            RegionMan.Log("Spatial Mapping halfBoxExtents set to :" + newhbe);
            Debug.Log("Spatial Mapping halfBoxExtents set to :" + newhbe);
        }
Beispiel #5
0
 void kROnPhraseRecognized2(PhraseRecognizedEventArgs args)
 {
     System.Action kwAction;
     if (keywords2.TryGetValue(args.text, out kwAction))
     {
         RegionMan.Log("You just said " + args.text);
         kwhistory.AddLast(args.text);
         kwAction.Invoke();
     }
     else
     {
         RegionMan.Log("Could not find " + args.text);
     }
 }