Exemplo n.º 1
0
    //public override void FromXML(XmlNode node, CameraPath cameraPath)
    //{
    //    base.FromXML(node, cameraPath);
    //    time = float.Parse(node["time"].FirstChild.Value);
    //    introStartEasePercentage = float.Parse(node["introStartEasePercentage"].FirstChild.Value);
    //    outroEndEasePercentage = float.Parse(node["outroEndEasePercentage"].FirstChild.Value);
    //    introCurve = XMLVariableConverter.FromXMLtoAnimationCurve(node["introCurve"]);
    //    outroCurve = XMLVariableConverter.FromXMLtoAnimationCurve(node["outroCurve"]);
    //}

    public override void FromXML(XMLNode node, CameraPath cameraPath)
    {
        base.FromXML(node, cameraPath);
        time = float.Parse(node.GetValue("time>0>_text"));
        introStartEasePercentage = float.Parse(node.GetValue("introStartEasePercentage>0>_text"));
        outroEndEasePercentage   = float.Parse(node.GetValue("outroEndEasePercentage>0>_text"));
        introCurve = XMLVariableConverter.FromXMLtoAnimationCurve(node.GetNode("introCurve>0"));
        outroCurve = XMLVariableConverter.FromXMLtoAnimationCurve(node.GetNode("outroCurve>0"));
    }
Exemplo n.º 2
0
    // GetNodeString
    #endregion

    #region GetNestedNodeString

    /// <summary>
    /// Get the string value from the xml node
    /// </summary>
    /// <param name="xmlNode"></param>
    /// <param name="key"></param>
    /// <param name="nodeChild"></param>
    /// <param name="nodeRoot"></param>
    /// <returns></returns>
    private string GetNestedNodeString(XMLNode xmlNode, string nodeRoot, string nodeChild, string key)
    {
        // exit if no nested node
        if (xmlNode.GetNode(nodeRoot) == null)
        {
            return(null);
        }

        XMLNode tempNode = xmlNode.GetNode(nodeRoot).GetNode(nodeChild);

        return(((tempNode != null) && (tempNode.ContainsKey(key))) ?
               tempNode[key].ToString() :
               null);
    }
Exemplo n.º 3
0
    // Init
    #endregion

    #region GetNodeString

    /// <summary>
    /// Get the string value from the xml node
    /// </summary>
    /// <param name="xmlNode"></param>
    /// <param name="node"></param>
    /// <param name="key"></param>
    /// <returns></returns>
    private string GetNodeString(XMLNode xmlNode, string node, string key)
    {
        XMLNode tempNode = xmlNode.GetNode(node);

        return(((tempNode != null) && (tempNode.ContainsKey(key))) ?
               tempNode[key].ToString() :
               null);
    }
Exemplo n.º 4
0
    // CheckHasXML
    #endregion

    #region ReadXML

    /// <summary>
    /// Reads the XML file
    /// </summary>
    private void ReadXML()
    {
        // read the XML file
        string XmlData;

        using (StreamReader reader = new StreamReader(string.Format("{0}/{1}", PsdAssetFolderPath, STR_NPSD_Dataxml)))
        {
            XmlData = reader.ReadToEnd();
        }

        // init the xml parser, then parse the doc
        XMLParser parser = new XMLParser();
        XMLNode   node   = parser.Parse(XmlData);

        // get the list of objects
        XmlObjectNodeList = node.GetNodeList(STR_Npsd0layer);

        // get width and height of PSD
        PsdWidth  = int.Parse(node.GetNode(STR_Npsd0)[STR_Width].ToString());
        PsdHeight = int.Parse(node.GetNode(STR_Npsd0)[STR_Height].ToString());

        // get total number of nodes / items
        TotalXmlItens = XmlObjectNodeList.Count;
    }
Exemplo n.º 5
0
 static int GetNode(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         XMLNode obj  = (XMLNode)ToLua.CheckObject(L, 1, typeof(XMLNode));
         string  arg0 = ToLua.CheckString(L, 2);
         XMLNode o    = obj.GetNode(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }