Beispiel #1
0
        private void AddTileAnimatorsTo(GameObject gameObject, XElement goXml)
        {
            foreach (var animXml in goXml.Elements("TileAnimator"))
            {
                TileAnimator tileAnimator = gameObject.AddComponent <TileAnimator>();

                foreach (var frameXml in animXml.Elements("Frame"))
                {
                    TileAnimator.Frame frame = new TileAnimator.Frame();
                    frame.Vertex_z   = ImportUtils.GetAttributeAsFloat(frameXml, "vertex_z");
                    frame.DurationMs = ImportUtils.GetAttributeAsInt(frameXml, "duration");
                    tileAnimator.frames.Add(frame);
                }
            }
        }
        private void AddTileAnimatorsTo(GameObject gameObject, XElement goXml)
        {
            foreach (var animXml in goXml.Elements("TileAnimator"))
            {
                TileAnimator tileAnimator = gameObject.AddComponent<TileAnimator>();

                foreach (var frameXml in animXml.Elements("Frame"))
                {
                    TileAnimator.Frame frame = new TileAnimator.Frame();
                    frame.Vertex_z = ImportUtils.GetAttributeAsFloat(frameXml, "vertex_z");
                    frame.DurationMs = ImportUtils.GetAttributeAsInt(frameXml, "duration");
                    tileAnimator.frames.Add(frame);
                }
            }
        }