Ejemplo n.º 1
0
        public SkinMeshData Load()
        {
            SkinMeshData skin = null;

            if (!string.IsNullOrEmpty(XmlData))
            {
                try
                {
                    Skill.Framework.IO.XmlDocument document = new Framework.IO.XmlDocument();
                    document.LoadXml(XmlData);
                    skin = new SkinMeshData();
                    skin.Load(document.FirstChild);
                }
                catch (System.Exception ex)
                {
                    skin = null;
                    Debug.LogException(ex, this);
                }
            }
            else
            {
                skin = new SkinMeshData();
                Save(skin);
            }
            skin.Name = this.name;
            return(skin);
        }
Ejemplo n.º 2
0
        public BehaviorTreeData Load()
        {
            BehaviorTreeData data = null;

            if (!string.IsNullOrEmpty(XmlData))
            {
                try
                {
                    Skill.Framework.IO.XmlDocument document = new Framework.IO.XmlDocument();
                    document.LoadXml(XmlData);
                    data = new BehaviorTreeData();
                    data.Load(document.FirstChild);
                }
                catch (System.Exception ex)
                {
                    data = null;
                    Debug.LogException(ex, this);
                }
            }
            else
            {
                data = new BehaviorTreeData();
                Save(data);
            }
            data.Name          = this.name;
            data.ExpandMethods = this.ExpandMethods;
            return(data);
        }
Ejemplo n.º 3
0
        public AnimationTreeData Load()
        {
            AnimationTreeData tree = null;

            if (!string.IsNullOrEmpty(XmlData))
            {
                try
                {
                    Skill.Framework.IO.XmlDocument document = new Framework.IO.XmlDocument();
                    document.LoadXml(XmlData);
                    tree = new AnimationTreeData();
                    tree.Load(document.FirstChild);
                }
                catch (System.Exception ex)
                {
                    tree = null;
                    Debug.LogException(ex, this);
                }
            }
            else
            {
                tree      = new AnimationTreeData();
                tree.Zoom = 1;
                tree.PanX = 0;
                tree.PanY = 0;
                Save(tree);
            }
            tree.Name     = this.name;
            tree.SkinMesh = (this.SkinMesh != null) ? this.SkinMesh.name : string.Empty;
            return(tree);
        }
Ejemplo n.º 4
0
        public SharedAccessKeysData Load()
        {
            SharedAccessKeysData data = null;

            if (!string.IsNullOrEmpty(XmlData))
            {
                try
                {
                    Skill.Framework.IO.XmlDocument document = new Framework.IO.XmlDocument();
                    document.LoadXml(XmlData);
                    data = new SharedAccessKeysData();
                    data.Load(document.FirstChild);
                }
                catch (System.Exception ex)
                {
                    data = null;
                    Debug.LogException(ex, this);
                }
            }
            else
            {
                data      = new SharedAccessKeysData();
                data.Keys = new AccessKeyData[0];
                Save(data);
            }
            data.Name = this.name;
            return(data);
        }
Ejemplo n.º 5
0
        public Skill.Framework.IO.XmlDocument ReadXml()
        {
            CheckForRead();
            string xmlData = ReadString();

            Skill.Framework.IO.XmlDocument document = new Framework.IO.XmlDocument();
            document.LoadXml(xmlData);
            return(document);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Paste localPosition, localRotation and localScale from clipboard as formated string to selected objetc
        /// </summary>
        public static void PasteTransformHierarchy()
        {
            Transform[] ts = Selection.transforms;
            if (ts != null && ts.Length > 0)
            {
                string tData = EditorGUIUtility.systemCopyBuffer;
                if (!string.IsNullOrEmpty(tData))
                {
                    try
                    {
                        Skill.Framework.IO.XmlDocument document = new Framework.IO.XmlDocument();
                        document.LoadXml(tData);

                        if (document.FirstChild != null)
                        {
                            TransformData td = new TransformData();
                            td.Load(document.FirstChild);

                            foreach (var t in ts)
                            {
                                td.Paste(t);
                            }
                            Debug.Log("Hierarchy Transform pasted.");
                        }
                        else
                        {
                            Debug.Log("Invalid Hierarchy Transform data.");
                        }
                    }
                    catch
                    {
                        Debug.Log("Invalid Hierarchy Transform data.");
                    }
                }
                else
                {
                    Debug.Log("Invalid Hierarchy Transform data.");
                }
            }
        }