예제 #1
0
 void MountedChildren(POCComponent node)
 {
     foreach (var child in node.Children)
     {
         MountedChildren(child);
         child.MountedBase();
     }
 }
예제 #2
0
        void DebugTree(POCComponent node)
        {
            Debug.Log($"Parent: {node.Parent}, Node: {node}, Child: {node.Children}");

            foreach (var child in node.Children)
            {
                DebugTree(child);
            }
        }
예제 #3
0
        /// <summary>
        /// Call child.Initialize() recursively by depth first
        /// </summary>
        /// <param name="node"></param>
        void InitializeChildren(Transform node, POCComponent parent)
        {
            var transform = node.transform;

            foreach (Transform child in transform)
            {
                var c = child.GetComponent <POCComponent>();
                c?.InitializeBase(parent);
                InitializeChildren(child, c ?? parent);
            }
        }
예제 #4
0
        public void InitializeBase(POCComponent parent)
        {
            if (!parent.IsShallowNode)
            {
                Parent = parent;
            }
            else
            {
                Parent = parent.Parent;
            }

            if (!IsShallowNode)
            {
                Parent.Children.Add(this);
            }

            Initialize();
        }