Ejemplo n.º 1
0
        /// <summary>
        /// Loads nodes from m_NodeSerialization.
        /// </summary>
        public void LoadNodes () {
            // Debug.Log("Loading Nodes " + name);

            // Validate the NodeSerialization object
            if (m_NodeSerialization == null)
                m_NodeSerialization = new NodeSerialization();

            // Is playing and this tree is enabled?
            if (m_NodesEnabled) {
                // Force ResetStatus
                if (m_FunctionNodes != null) {
                    for (int i = 0; i < m_FunctionNodes.Length; i++)
                        m_FunctionNodes[i].ResetStatus();
                }

                // Call OnDisable in nodes
                if (m_Nodes != null) {
                    for (int i = 0; i < m_Nodes.Length; i++)
                        m_Nodes[i].OnDisable();
                }
            }

            // Load nodes
            m_Nodes = m_NodeSerialization.LoadNodes(gameObject, this);

            if (m_HierarchyChanged) {
                m_HierarchyChanged = false;
                UpdateNodes();
            }

            if (m_NodeSerialization.resaveNodes)
                SaveNodes();

            m_FunctionNodes = this.GetFunctionNodes();

            // Awake nodes?
            if (m_NodesWaked)
                this.WakeNodes();

            // Reenable nodes
            if (m_NodesEnabled)
                this.OnEnableNodes();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads nodes from m_NodeSerialization.
        /// </summary>
        public void LoadNodes () {
            // Debug.Log("Loading Nodes " + name);

            // Disable nodes?
            if (m_NodesEnabled)
                this.ForceOnDisableNodes();

            if (m_NodeSerialization == null)
                m_NodeSerialization = new NodeSerialization();

            m_Nodes = m_NodeSerialization.LoadNodes(gameObject, this);

            if (m_NodeSerialization.resaveNodes) {
                SaveNodes();
            }

            this.CreateRuntimeListsOfNodes();

            m_IsDirty = false;

            // Awake nodes?
            if (m_NodesWaked)
                this.WakeNodes();

            // Reenabled nodes?
            if (m_NodesEnabled)
                this.OnEnableNodes();
        }