public static void SaveViNoSceneNodes( ref List<SceneData.SceneNodeData> nodelist , ISpriteFactory fact ) { ViNoSceneNode[] sceneNodesData = GameObject.FindObjectsOfType( typeof( ViNoSceneNode ) ) as ViNoSceneNode[]; if( sceneNodesData != null ){ for( int i=0;i<sceneNodesData.Length;i++){ GameObject sceneNode = sceneNodesData[ i ].gameObject; if( sceneNodesData[ i ].singleNodeData != null ){ SceneData.SceneNodeData data = sceneNodesData[ i ].singleNodeData; nodelist.Add( data ); fact.SaveData( ref data , sceneNode ); } /* else{ if( sceneNodesData[ i ].scrNodeData.nodesData != null ){ int len = sceneNodesData[ i ].scrNodeData.nodesData.Length; for( int k=0;k<len;k++){ SceneData.SceneNodeData data = sceneNodesData[ i ].scrNodeData.nodesData[ k ]; nodelist.Add( data ); GameObject obj = GameObject.Find( data.name );//sceneNode.gameObject.transform.FindChild( data.name ).gameObject; fact.SaveData( ref data , obj ); } } } //*/ } } }
static public void SaveViNoSceneNodes(ref List <SceneData.SceneNodeData> nodelist, ISpriteFactory fact) { ViNoSceneNode[] sceneNodesData = GameObject.FindObjectsOfType(typeof(ViNoSceneNode)) as ViNoSceneNode[]; if (sceneNodesData != null) { for (int i = 0; i < sceneNodesData.Length; i++) { GameObject sceneNode = sceneNodesData[i].gameObject; if (sceneNodesData[i].singleNodeData != null) { SceneData.SceneNodeData data = sceneNodesData[i].singleNodeData; nodelist.Add(data); fact.SaveData(ref data, sceneNode); } /* * else{ * if( sceneNodesData[ i ].scrNodeData.nodesData != null ){ * int len = sceneNodesData[ i ].scrNodeData.nodesData.Length; * for( int k=0;k<len;k++){ * SceneData.SceneNodeData data = sceneNodesData[ i ].scrNodeData.nodesData[ k ]; * nodelist.Add( data ); * GameObject obj = GameObject.Find( data.name );//sceneNode.gameObject.transform.FindChild( data.name ).gameObject; * fact.SaveData( ref data , obj ); * } * } * } * //*/ } } }
public static void SaveDataRecursively( GameObject savedObj , ref List<SceneData.SceneNodeData> nodelist , ref ISpriteFactory spriteFact ) { SceneData.SceneNodeData data = new SceneData.SceneNodeData(); nodelist.Add( data ); spriteFact.SaveData( ref data , savedObj ); int count = savedObj.transform.GetChildCount(); if( count > 0 ){ for(int i=0;i<count;i++){ GameObject childObj = savedObj.transform.GetChild( i ).gameObject; SaveDataRecursively( childObj ,ref nodelist , ref spriteFact ); } } }
static public void SaveDataRecursively(GameObject savedObj, ref List <SceneData.SceneNodeData> nodelist, ref ISpriteFactory spriteFact) { SceneData.SceneNodeData data = new SceneData.SceneNodeData(); nodelist.Add(data); spriteFact.SaveData(ref data, savedObj); int count = savedObj.transform.GetChildCount(); if (count > 0) { for (int i = 0; i < count; i++) { GameObject childObj = savedObj.transform.GetChild(i).gameObject; SaveDataRecursively(childObj, ref nodelist, ref spriteFact); } } }