public override void OnInspectorGUI() { ReplaceView abc = target as ReplaceView; obj.Update(); EditorGUILayout.PropertyField(obj.FindProperty("prefab"), true); EditorGUILayout.PropertyField(obj.FindProperty("needCheck"), true); if (abc != null) { if (GUILayout.Button("Replace")) { abc.DrawBtn(); } } obj.ApplyModifiedProperties(); }
public void ViewManagerCreateView() { DynamicMock useCase = new DynamicMock(typeof(IUseCase)); IUseCase useCaseMockInstance = (IUseCase)useCase.MockInstance; IRegexEngine engine = new DotNetRegexEngine(); IRegexView view = new ReplaceView(); useCase.ExpectAndReturn("CreateNewView", view); useCase.ExpectAndReturn("CreateNewEngine", engine); ViewManager factory = new ViewManager(); IRegexView newView = factory.CreateView(useCaseMockInstance); Form frm = (Form)newView; frm.ShowDialog(); }