Ejemplo n.º 1
0
        protected virtual void OnEnable()
        {
            if (indexState == null)
            {
                indexState = new TreeViewState();
            }
            libIndex = new SeanLibIndex(indexState);
            libIndex.RefreshTreeData(this);
            libIndex.SetSelection(new List <int>()
            {
                EditorPrefs.GetInt(IndexKey, 1)
            });

            VisualElement root = rootVisualElement;

            var visualTree = AssetDBHelper.LoadAsset <VisualTreeAsset>(FileAsset.BaseType, FileAsset.UXML);
            var styleSheet = AssetDBHelper.LoadAsset <StyleSheet>(FileAsset.BaseType, FileAsset.USS);

            root.styleSheets.Add(styleSheet);
            visualTree.CloneTree(root);

            //目录
            EditorIndex = root.Q <VisualElement>("EditorIndex");
            EditorIndexContent_IMGUI = EditorIndex.Q <IMGUIContainer>("EditorIndexContent_IMGUI");
            EditorIndexContent_IMGUI.onGUIHandler = () => { libIndex.OnGUI(EditorIndexContent_IMGUI.contentRect); };
            //内容
            EditorContent = root.Q <VisualElement>("EditorContent");
        }
Ejemplo n.º 2
0
        public static TweenCurve Get(string Name)
        {
            var curveAssets = AssetDBHelper.LoadAssets <EditorTweenCurve>(" t:EditorTweenCurve");

            foreach (var asset in curveAssets)
            {
                var curve = asset.Curves.Find(e => e.name == Name);
                if (curve != null)
                {
                    return(curve);
                }
            }
            return(null);
        }