コード例 #1
0
        public bool SetVector(XmlNode channels, string valueName)
        {
            XmlNode nodeXml = channels.SelectSingleNode(valueName);

            if (nodeXml != null)
            {
                Vector3 vector = SmallParserUtils.ParseVectorXml(nodeXml.InnerText);
                _material.SetVector(valueName, vector);
                return(true);
            }
            return(false);
        }
コード例 #2
0
        public static void ParseTransformXml(XmlNode node, GameObject gameObject, string type)
        {
            string location = node.SelectSingleNode("Position").InnerText;
            string rotation = node.SelectSingleNode("Rotation").InnerText;
            string scale    = node.SelectSingleNode("Scale").InnerText;
            string name     = node.SelectSingleNode("Name").InnerText;

            gameObject.name = name;
            gameObject.transform.localPosition = SmallParserUtils.ParseVectorXml(location);
            gameObject.transform.localScale    = SmallParserUtils.ParseVectorXml(scale);

            Vector3 rotationVector = SmallParserUtils.ParseVectorXml(rotation);

            gameObject.transform.rotation = new Quaternion();
            gameObject.transform.Rotate(new Vector3(rotationVector[0] * -1, 0, 0), Space.World);
            gameObject.transform.Rotate(new Vector3(0, rotationVector[2] * -1, 0), Space.World);
            gameObject.transform.Rotate(new Vector3(0, 0, rotationVector[1] * -1), Space.World);
        }