protected override void ModifyMonoBehaviour() { base.ModifyMonoBehaviour(); this.childSortingOrderUpdaters = ModificationUtility.GetDirectChildComponents <SortingOrderUpdater>(this); gameObject.layer = ConstUi.UserLayerMask; ModifyComponentInDerivedClass(); }
private void TryCreateProductionOrTestClass(IReadOnlyCollection <ITypeElement> typesInContext) { if (typesInContext.Count != 1) { MessageBox.ShowInfo("There is no single class in context to create production/test class from."); return; } ModificationUtility.TryCreateTestOrProductionClass(typesInContext.Single(), _textControl); }
void ModifyCanvasScaler() { if (canvas.rootCanvas == canvas) { var canvasScaler = ModificationUtility.GetAndAddComponent <CanvasScaler>(this); DefaultSettingUtility.SetCanvasScaler(canvasScaler); } else { ModificationUtility.DeleteComponent <CanvasScaler>(this); } }
public override ICollection <IOccurrence> Search(IProgressIndicator progressIndicator) { if (!_typeElement.IsValid()) { return(EmptyList <IOccurrence> .InstanceList); } var linkedTypes = LinkedTypesUtil.GetLinkedTypes(_typeElement); if (linkedTypes.Count == 0) { ModificationUtility.TryCreateTestOrProductionClass(_typeElement, _textControl); } bool IsDerivedName(ITypeElement typeElement) => _typeElement.ShortName.Contains(typeElement.ShortName) || typeElement.ShortName.Contains(_typeElement.ShortName); return(linkedTypes .Select(x => new LinkedTypesOccurrence(x, OccurrenceType.Occurrence, IsDerivedName(x))) .Where(x => !_derivedNamesOnly || x.HasNameDerived) .ToArray()); }
void ModifyGraphicRaycaster() { var graphicRaycaster = ModificationUtility.GetAndAddComponent <GraphicRaycaster>(this); DefaultSettingUtility.SetGraphicRaycaster(graphicRaycaster); }