コード例 #1
0
        /// <summary>
        /// Instanciate new group object.
        /// </summary>
        /// <returns>The group.</returns>
        public static AgaQGroup InstansiateAgaQGroup()
        {
            GameObject groupObject = new GameObject();

            groupObject.name = "AgaQ Group";
            groupObject.transform.SetParent(GameObject.Find("Model").transform);
            AgaQGroup groupScript = groupObject.AddComponent <AgaQGroup>();

            return(groupScript);
        }
コード例 #2
0
        /// <summary>
        /// Deserializes AgaQ group.
        /// </summary>
        /// <param name="xmlReader">Xml reader.</param>
        /// <param name="parent">Parent.</param>
        /// <param name="group">If set to <c>true</c> group.</param>
        void DeserializeAgaQGroup(XmlReader xmlReader, Transform parent, bool group)
        {
            AgaQGroup groupScript = BrickBuilder.InstansiateAgaQGroup();

            groupScript.Deserialize(xmlReader);

            if (parent != null)
            {
                groupScript.transform.SetParent(parent);
            }

            var subReader = xmlReader.ReadSubtree();

            subReader.Skip();
            Deserialize(subReader, groupScript.gameObject.transform, true);

            xmlReader.Skip();
        }