private WordAbstractBehaviour AssociateWordBehaviour(WordResult wordResult, WordAbstractBehaviour wordBehaviourTemplate)
    {
        if (this.mActiveWordBehaviours.Count >= this.mMaxInstances)
        {
            return(null);
        }
        Word word = wordResult.Word;
        WordAbstractBehaviour behaviour  = wordBehaviourTemplate;
        IEditorWordBehaviour  behaviour2 = behaviour;

        behaviour2.SetNameForTrackable(word.StringValue);
        behaviour2.InitializeWord(word);
        this.mActiveWordBehaviours.Add(word.ID, behaviour);
        return(behaviour);
    }
Exemplo n.º 2
0
 private void UpdateTrackablesEditor()
 {
     TrackableBehaviour[] behaviourArray = (TrackableBehaviour[])UnityEngine.Object.FindObjectsOfType(typeof(TrackableBehaviour));
     foreach (TrackableBehaviour behaviour in behaviourArray)
     {
         if (behaviour.enabled)
         {
             if (behaviour is WordAbstractBehaviour)
             {
                 IEditorWordBehaviour behaviour2 = (IEditorWordBehaviour)behaviour;
                 behaviour2.SetNameForTrackable(behaviour2.IsSpecificWordMode ? behaviour2.SpecificWord : "AnyWord");
                 behaviour2.InitializeWord(new WordImpl(0, behaviour2.TrackableName, new Vector2(500f, 100f)));
             }
             behaviour.OnTrackerUpdate(TrackableBehaviour.Status.TRACKED);
         }
     }
 }