示例#1
0
        /// <summary>
        /// Creates a new <see cref="BodyInfo"/> instance and adds it to this <see cref="BodyInfoManager"/>.
        /// </summary>
        /// <remarks>
        /// Should only be used in the editor.
        /// </remarks>
        /// <returns>The new <see cref="BodyInfo"/> instance.</returns>
        public BodyInfo CreateBody()
        {
            var id = GetNextFreeID();
            var body = new BodyInfo(id);

            Debug.Assert(!_bodies.ContainsKey(id));
            _bodies.Add(id, body);

            return body;
        }