public static YamlUnityObject Create(string type) { YamlUnityObject obj = null; switch (type) { case "GameObject": obj = new YamlGameObject(); break; case "Transform": obj = new YamlTransform(); break; case "ParticleSystem": obj = new YamlParticleSystem(); break; //--其他的不管了 } if (obj != null) { obj.TypeName = type; } return(obj); }
YamlGameObject SearchChild(YamlGameObject node, string name) { //Debug.Log("search .. "+ node.NameNode + " filter : " + name); foreach (var yamlTransform in node.Transofrm.Children) { //Debug.Log("child search : " +yamlTransform.ObjectName); if (yamlTransform.ObjectName == name) { return(yamlTransform.GameObject); } } foreach (var yamlTransform in node.Transofrm.Children) { var res = SearchChild(yamlTransform.GameObject, name); if (res != null) { return(res); } } return(null); }
public void SetAttachGameObject(YamlGameObject obj) { AttachGameObject = obj; }