Exemplo n.º 1
0
        private G2OM(G2OM_Description description)
        {
            var expectedNumberOfCandidates = description.ExpectedNumberOfObjects;

            _context = description.Context;
            _context.Setup(expectedNumberOfCandidates); // TODO: What if this fails???

            _howLongToKeepCandidatesInMemory = description.HowLongToKeepCandidatesInSeconds;

            _objectFinder = description.ObjectFinder;
            _objectFinder.SetLayerMask(description.LayerMask);

            _colliderDataProvider = description.ColliderDataProvider;
            _objectDistinguisher  = description.Distinguisher;
            _postTicker           = description.PostTicker;

            _newCandidates      = new Dictionary <int, GameObject>(expectedNumberOfCandidates);
            _internalCandidates = new Dictionary <int, InternalCandidate>(expectedNumberOfCandidates);

            _gazeFocusedObjects = new List <FocusedCandidate>(expectedNumberOfCandidates);
            _keysToRemove       = new List <int>(expectedNumberOfCandidates);

            _nativeCandidates       = new G2OM_Candidate[expectedNumberOfCandidates];
            _nativeCandidatesResult = new G2OM_CandidateResult[expectedNumberOfCandidates];
        }
Exemplo n.º 2
0
        private G2OM(G2OM_Description description)
        {
            _internalCapacity = (int)description.Options.capacity;
            _howLongToKeepCandidatesInMemory = description.HowLongToKeepCandidatesInSeconds;

            _context = description.Context;
            _context.Setup(description.Options);

            _objectFinder = description.ObjectFinder;
            _objectFinder.Setup(_context, description.LayerMask);

            _colliderDataProvider = description.ColliderDataProvider;
            _distinguisher        = description.Distinguisher;
            _postTicker           = description.PostTicker;

            _newCandidates      = new Dictionary <int, GameObject>(_internalCapacity);
            _internalCandidates = new Dictionary <int, InternalCandidate>(_internalCapacity);

            _gazeFocusedObjects = new List <FocusedCandidate>(_internalCapacity);
            _keysToRemove       = new List <int>(_internalCapacity);

            _nativeCandidates       = new G2OM_Candidate[_internalCapacity];
            _nativeCandidatesResult = new G2OM_CandidateResult[_internalCapacity];
        }
Exemplo n.º 3
0
 public void Setup(IG2OM_Context context, LayerMask layerMask)
 {
     _layerMask = layerMask;
     _context   = context;
 }