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

            foreach (var child in node.Children)
            {
                DebugTree(child);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 4
0
        public void InitializeBase(POCComponent parent)
        {
            if (!parent.IsShallowNode)
            {
                Parent = parent;
            }
            else
            {
                Parent = parent.Parent;
            }

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

            Initialize();
        }