Esempio n. 1
0
        private void UnsubscribeRefinement <TRefinement>() where TRefinement : RefinementBase
        {
            // Attempt to get the refinement
            TRefinement refinement = largeScaleModel.GetComponent <TRefinement>();

            // If found, unsubscribe from refinement events
            if (refinement != null)
            {
                UnsubscribeRefinement(refinement);
            }
        }
Esempio n. 2
0
        private TRefinement SubscribeRefinement <TRefinement>() where TRefinement : RefinementBase
        {
            // If refinement doesn't exist, add it
            TRefinement refinement = largeScaleModel.EnsureComponent <TRefinement>();

            // Subscribe to refinement events
            refinement.RefinementCanceled += LargeScaleRefinement_RefinementCanceled;
            refinement.RefinementFinished += LargeScaleRefinement_RefinementFinished;

            // Return the refinement
            return(refinement);
        }