/// <summary>
        /// 手動建立節點之間的關係
        /// Example:
        ///                                          ERedPointMainNode(Mail, Buddy)
        ///                                             /                      \
        ///                ERedPointMailNode(Read, Unread)                     ERedPointBuddyNode(Message, Buddies)
        ///                    /                       \                           /                           \
        ///   ERedPointEmailNode(Read)     ERedPointEmailNode(Unread)    ERedPointMessageNode(Read,Unread)    ERedPointBuddyNode(Message,Buddies)
        ///                                                                  /                         \
        ///                                                  ERedPointMessageNode(Read)     ERedPointMessageNode(Unread)
        /// </summary>
        /// <param name="nodes"></param>
        /// <returns></returns>
        public static RedPointTreeMapExample Create(Type nodes)
        {
            var tree = new RedPointTreeMapExample(nodes);

            // root/Buddy
            tree.AddChild(ERedPointMainNode.Buddy, typeof(ERedPointBuddy));
            // root/Buddy/BuddyMessage
            tree.AddChild(ERedPointBuddy.Message, typeof(ERedPointBuddyMessage));
            // root/Mail/Message
            tree.AddChild(ERedPointMainNode.Mail, typeof(ERedPointEmail));
            return(tree);
        }
Exemple #2
0
 private void Awake()
 {
     InitTree(RedPointTreeMapExample.Create(typeof(ERedPointMainNode)));
 }