public static CfgEncoder Encode(this Transform tf, bool local)
        {
            var cody = new CfgEncoder();

            cody.Add_Bool("loc", local);

            if (local)
            {
                cody.Add("pos", tf.localPosition);
                cody.Add("size", tf.localScale);
                cody.Add("rot", tf.localRotation);
            }
            else
            {
                cody.Add("pos", tf.position);
                cody.Add("size", tf.localScale);
                cody.Add("rot", tf.rotation);
            }

            return(cody);
        }
Exemple #2
0
        public override CfgEncoder Encode()
        {
            var cody = new CfgEncoder()
                       .Add_IfNotEmpty("n", name)
                       .Add_IfNotEmpty("cfg", stdDta);

            if (!_guid.IsNullOrEmpty())
            {
                cody.Add_IfNotEmpty("guid", _guid)
                .Add_IfNotEmpty("t", componentType);
            }

            cody.Add_IfNotEmpty("perType", _perTypeConfig)
            .Add_IfTrue("sel", selected);

            if (unrecognized)
            {
                cody.Add_Bool("ur", unrecognized)
                .Add_String("tag", unrecognizedUnderTag);
            }
            return(cody);
        }
Exemple #3
0
            public override CfgEncoder Encode()
            {
                var cody = new CfgEncoder()
                           .Add_Bool("ch", allowChangeParameters);

                if (allowChangeParameters)
                {
                    if (EaseInOutImplemented)
                    {
                        cody.Add_Bool("eio", easeInOut);
                    }

                    cody.Add("lm", (int)lerpMode);

                    if (lerpMode == LerpSpeedMode.SpeedThreshold)
                    {
                        cody.Add("sp", speedLimit);
                    }
                }

                return(cody);
            }