Ejemplo n.º 1
0
        /// <summary>
        /// Synchronize the mount point state of all common mount points.
        /// </summary>
        /// <param name="to">The outfit being synchonized to. (Required)</param>
        /// <param name="from">The outfit being syncronzied from. (Required)</param>
        /// <param name="includeBlocked">Synchronize the mount point 'is blocked' state.</param>
        /// <param name="includeContext">
        /// Synchronize the context unless it is the <paramref name="from"/> object's GameObject.
        /// </param>
        public static void SynchronizeMountPointState(Outfit to, Outfit from, bool includeBlocked, bool includeContext)
        {
            if (!(from && to))
            {
                return;
            }

            for (int i = 0; i < from.MountPointCount; i++)
            {
                var prevPart = from.GetMountPoint(i);
                if (prevPart)
                {
                    var part = to.GetMountPoint(prevPart.LocationType);
                    if (part)
                    {
                        MountPoint.Synchronize(part, prevPart, includeBlocked, includeContext, from.gameObject);
                    }
                }
            }
        }
 /// <summary>
 /// Synchronize the state to the specified mount point using the observer's settings.
 /// </summary>
 /// <remarks>
 /// <para>
 /// The block state and context are synchronized, depending on the observer settings.  Other
 /// properties such as location type, transform values, etc., are ignored.
 /// </para>
 /// </remarks>
 /// <param name="to">The mount point to sync to. (Required)</param>
 /// <param name="from">The mount point to sync from. (Required)</param>
 /// The context that should never be synchronized. (Usually the <paramref name="from"/>'s GameObject.
 /// (Required if observer is configured to include context.)
 /// </param>
 public virtual void Synchronize(MountPoint to, MountPoint from, GameObject ignoreContext)
 {
     MountPoint.Synchronize(to, from, m_BlockedStatus, m_Context, ignoreContext);
 }