コード例 #1
0
        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);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 public InspectorController(InspectorView view, IHexGridController gridController)
 {
     this.view           = view;
     this.gridController = gridController;
     consoleController   = gridController.Console;
     contentFactory      = new InspectorContentViewFactory(view);
     contentViews        = new List <IInspectorContentView>();
     ConfigureViews();
 }
コード例 #4
0
 public InvokableInspectorController(InspectorView view, IHexGridController gridController)
     : base(view, gridController)
 {
 }
コード例 #5
0
 public InspectorContentViewFactory(InspectorView inspectorView)
 {
     this.inspectorView = inspectorView;
     successColor       = inspectorView.StringSmallEditPrefab.InputText.targetGraphic.color;
 }