Ejemplo n.º 1
0
        //------------------------------------------------------------------------/
        // Methods
        //------------------------------------------------------------------------/
        /// <summary>
        /// Checks whether the given instance id is a valid asset for this tree view,
        /// if so it sets it
        /// </summary>
        /// <param name="instanceID"></param>
        /// <param name="line"></param>
        /// <returns></returns>
        public bool TryOpenAsset(int instanceID, int line)
        {
            StratusTreeAsset <TreeElementType> treeAsset = EditorUtility.InstanceIDToObject(instanceID) as StratusTreeAsset <TreeElementType>;

            if (treeAsset != null)
            {
                this.SetTreeAsset(treeAsset);
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the current tree asset at runtime
 /// </summary>
 /// <param name="asset"></param>
 public void SetTreeAsset(StratusTreeAsset <TreeElementType> asset)
 {
     this.treeAsset = asset;
     this.SetTree(asset.elements);
 }