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); } }
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); }