コード例 #1
0
 internal void Write(ParameterTreeWriter writer)
 {
     writer.Write("name", Name);
     writer.Write("posx", Position.X);
     writer.Write("posy", Position.Y);
     writer.Write("posz", Position.Z);
 }
コード例 #2
0
        internal void Write(ParameterTreeWriter writer)
        {
            writer.PushScope(Name);
            {
                writer.PushScope("root");
                {
                    writer.Write("force", Force);
                    writer.Write("force_gain", ForceGain);
                    writer.Write("air_res", AirResistance);
                    writer.Write("rot_y", RotationY);
                    writer.Write("rot_z", RotationZ);
                    writer.Write("friction", Friction);
                    writer.Write("wind_afc", WindAffection);
                    writer.Write("coli_type", CollisionType);
                    writer.Write("init_rot_y", InitRotationY);
                    writer.Write("init_rot_z", InitRotationZ);
                    writer.Write("hinge_y", HingeY);
                    writer.Write("hinge_z", HingeZ);
                    writer.Write("coli_r", CollisionRadius);
                    writer.Write("stiffness", Stiffness);
                    writer.Write("move_cancel", MoveCancel);

                    writer.Write("coli", Collisions, x => x.Write(writer));
                    writer.Write("boc", Bocs, x => x.Write(writer));
                }
                writer.PopScope();

                writer.Write("node", Nodes, x => x.Write(writer));
            }
            writer.PopScope();
        }
コード例 #3
0
 internal void Write(ParameterTreeWriter writer)
 {
     writer.Write("hinge_ymin", HingeYMin);
     writer.Write("hinge_ymax", HingeYMax);
     writer.Write("hinge_zmin", HingeZMin);
     writer.Write("hinge_zmax", HingeZMax);
     writer.Write("coli_r", Radius);
     writer.Write("inertial_cancel", InertialCancel);
     writer.Write("weight", Weight);
 }
        public override void Write(EndianBinaryWriter writer, ISection section = null)
        {
            if (section != null)
            {
                WriteModern();
            }
            else
            {
                WriteClassic();
            }

            void WriteClassic()
            {
                var paramWriter = new ParameterTreeWriter();

                writer.WriteLine("# This file was generated automatically. DO NOT EDIT.");

                foreach (var parameter in Parameters)
                {
                    parameter.Write(paramWriter);
                }

                paramWriter.Flush(writer.BaseStream);
            }

            void WriteModern()
            {
                if (section.Format == BinaryFormat.X)
                {
                    writer.Write(Parameters.Count);
                    writer.WriteNulls(2 * sizeof(uint));

                    writer.ScheduleWriteOffset(16, AlignmentMode.Left, WriteParameters);
                    writer.WriteNulls(2 * sizeof(ulong));
                }
                else
                {
                    writer.Write(Parameters.Count);
                    writer.ScheduleWriteOffset(16, AlignmentMode.Left, WriteParameters);
                    writer.WriteNulls(4 * sizeof(uint));
                }
            }

            void WriteParameters()
            {
                foreach (var parameter in Parameters)
                {
                    parameter.Write(writer);
                }
            }
        }
        internal void Write(ParameterTreeWriter writer)
        {
            writer.Write("type", Type);
            writer.Write("radius", Radius);

            writer.PushScope("bone");
            {
                writer.PushScope(0);
                {
                    Bone0.Write(writer);
                }
                writer.PopScope();

                writer.PushScope(1);
                {
                    Bone1.Write(writer);
                }
                writer.PopScope();
            }
            writer.PopScope();
        }
 internal void Write(ParameterTreeWriter writer)
 {
     writer.Write("st_node", StNode);
     writer.Write("ed_node", EdNode);
     writer.Write("ed_root", EdRoot);
 }