private void OnEnable()
        {
            _myTarget = (IconLibrary)target;

            FindProperty("Icons");
            var iconsProp = GetProperty("Icons");

            _iconList = new ReorderableList(serializedObject, iconsProp, true, true, true, true);
            _iconList.elementHeight       = 50;
            _iconList.drawHeaderCallback  = DrawIconListHeader;
            _iconList.drawElementCallback = DrawIconListElement;
            _iconList.onAddCallback       = (ReorderableList list) =>
            {
                _myTarget.Icons.Add(new IconData());
                PrefabUtility.RecordPrefabInstancePropertyModifications(_myTarget);
            };
            _iconList.onRemoveCallback = (ReorderableList list) =>
            {
                ReorderableList.defaultBehaviours.DoRemoveButton(list);
                PrefabUtility.RecordPrefabInstancePropertyModifications(_myTarget);
            };
        }
Пример #2
0
        public override void Init(IDialogueUIController controller)
        {
            base.Init(controller);

            _iconLibrary = GetComponentInParent <IconLibrary>();
        }