示例#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];
        }
示例#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];
        }
示例#3
0
 public static G2OM Create(G2OM_Description description)
 {
     return(new G2OM(description));
 }