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); }
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); }
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); }