Version: 2021.1
言語: 日本語
protected IList<int> GetAncestors (int id);

パラメーター

id TreeViewItem ID.

戻り値

IList<int> List of all the ancestors of a given item with ID id.

説明

This method is e.g. used for revealing items that are currently under a collapsed item.

It is called automatically from TreeView methods such as RevealItem. If the full item tree have not been built in BuildRoot(), you should override this method to use your backend data to find the correct ancestors for the given item otherwise RevealItem will fail.

Default behavior: The item with ID id is found by searching from the rootItem through all its descendants. Once found, its parent and its parent’s parent, etc. are collected as ancestors. This efault behavior assumes the full tree has been built.

See Also: GetDescendantsThatHaveChildren.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961