Ejemplo n.º 1
0
        /// <summary>Creates a new instance from the provided string.</summary>
        /// <param name="strValue">The value to parse.</param>
        /// <param name="failOnError">
        /// If <c>true</c> then a parsing error will fail the creation. Otherwise, a default instance will
        /// be returned.
        /// </param>
        /// <returns>An instance, intialized from the string.</returns>
        public static PosAndRot FromString(string strValue, bool failOnError = false)
        {
            var res = new PosAndRot();

            try {
                res.ParseFromString(strValue);
            } catch (ArgumentException ex) {
                if (failOnError)
                {
                    throw;
                }
                DebugEx.Warning("Cannot parse PosAndRot, using default: {0}", ex.Message);
            }
            return(res);
        }
Ejemplo n.º 2
0
 /// <summary>Constructs a copy of an object of the same type.</summary>
 /// <param name="from">Source object.</param>
 public PosAndRot(PosAndRot from)
 {
     pos   = from.pos;
     euler = from.euler;
 }