protected override void Reset()
 {
     m_BlendRenderer   = null;
     m_OutfitMaterials = new OutfitMaterialTargetGroup();  // Materials Reset() is not as safe.
     m_Parts.Clear(0);
     m_Accessories.Clear();
     Observers.Clear();
     base.Reset();
 }
示例#2
0
        /// <summary>
        /// Replaces the current items with the specified items.
        /// </summary>
        /// <remarks>
        /// <para>
        /// To use this method safely either set <paramref name="asReference"/> to false or
        /// discard all external refrences to <paramref name="items"/>.
        /// </para>
        /// </remarks>
        /// <param name="bodyParts">The object to update. (Required)</param>
        /// <param name="items">The items.</param>
        /// <param name="asReference">
        /// If true the internal buffer will be replaced with a reference to
        /// <paramref name="items"/>, otherwise <paramref name="items"/> will be copied.
        /// </param>
        public static void UnsafeReplaceItems(
            BodyPartGroup bodyParts, bool asReference, params BodyPart[] items)
        {
            // Null elements are allowed.

            if (items == null)
            {
                bodyParts.Clear(0);
            }
            else
            {
                bodyParts.m_Items = asReference ? items : (BodyPart[])items.Clone();
            }
        }