Esempio n. 1
0
        void Awake()
        {
            controller = (ViewStateController)target;

            visibleOnIcon  = EditorGUIUtility.IconContent("animationvisibilitytoggleon");
            visibleOffIcon = EditorGUIUtility.IconContent("animationvisibilitytoggleoff");

            list = new ReorderableList(controller.states, typeof(GameObject), true, true, true, true);

            ReorderableListUtil.SetColumns(list, new List <ReorderableListColumn <GameObject> >
            {
                new ReorderableListColumn <GameObject> {
                    Name         = "Id",
                    Width        = 20,
                    ItemRenderer = (GameObject state, Rect rect, int index, bool isActive, bool isFocused) => {
                        EditorGUI.LabelField(rect, "" + index);
                    }
                },
                new ReorderableListColumn <GameObject> {
                    Name         = "State",
                    WidthRatio   = 1,
                    ItemRenderer = (GameObject state, Rect rect, int index, bool isActive, bool isFocused) => {
                        controller.states[index] = (GameObject)EditorGUI.ObjectField(rect, state, typeof(GameObject), true);
                    }
                },
                new ReorderableListColumn <GameObject> {
                    Name         = "",
                    Width        = 10,
                    ItemRenderer = (GameObject state, Rect rect, int index, bool isActive, bool isFocused) => {
                        EditorGUI.LabelField(rect, "");
                    }
                },
                new ReorderableListColumn <GameObject> {
                    Name         = "",
                    Width        = 15,
                    ItemRenderer = (GameObject state, Rect rect, int index, bool isActive, bool isFocused) => {
                        var content = state.activeSelf ? visibleOnIcon : visibleOffIcon;
                        var r       = new Rect(rect);
                        r.y        += 4;
                        var b       = GUI.Toggle(r, state.activeSelf, content, GUIStyle.none);
                        if (b != state.activeSelf && b)
                        {
                            controller.SetState(state);
                        }
                    }
                }
            });
        }
Esempio n. 2
0
 private void HandleStoreOpened()
 {
     viewStateController.SetState(ViewStateEnum.Store);
 }
Esempio n. 3
0
 private void HandleStoreOpened(SellerControllerConfig sellerControllerConfig)
 {
     sellerViewController.CurrentConfig = sellerControllerConfig;
     viewStateController.SetState(ViewStateEnum.Seller);
 }