public static IInspectorController MakeController(InspectorView view, IHexGridController grid, BaseNode.NodeType type) { IInspectorController result = null; switch (type) { case BaseNode.NodeType.Group: result = new GroupInspectorController(view, grid); break; case BaseNode.NodeType.Invokable: result = new InvokableInspectorController(view, grid); break; case BaseNode.NodeType.Tweakable: result = new TweakableInspectorController(view, grid); break; default: LogManager.GetCurrentClassLogger().Error("Cannot inspect node of type {0}", type); result = null; break; case BaseNode.NodeType.Watchable: break; } return(result); }
private void CreateInspector(BaseNode.NodeType type) { InspectorView inspectorView = Object.Instantiate(InspectorViewPrefab); inspectorView.GetComponent <RectTransform>().SetParent(GetComponent <RectTransform>(), worldPositionStays: false); inspector = InspectorControllerFactory.MakeController(inspectorView, GridController, type); inspector.Closed += InspectorClosed; }
public InspectorController(InspectorView view, IHexGridController gridController) { this.view = view; this.gridController = gridController; consoleController = gridController.Console; contentFactory = new InspectorContentViewFactory(view); contentViews = new List <IInspectorContentView>(); ConfigureViews(); }
public InvokableInspectorController(InspectorView view, IHexGridController gridController) : base(view, gridController) { }
public InspectorContentViewFactory(InspectorView inspectorView) { this.inspectorView = inspectorView; successColor = inspectorView.StringSmallEditPrefab.InputText.targetGraphic.color; }