Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 public void SetAttachGameObject(YamlGameObject obj)
 {
     AttachGameObject = obj;
 }