Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions EXILED/Exiled.API/Extensions/MirrorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,44 @@ public static void MessageTranslated(this Player player, string words, string tr
}
}

/// <summary>
/// Scale the object for a player.
/// </summary>
/// <param name="player">Target to send.</param>
/// <param name="identity">The <see cref="Mirror.NetworkIdentity"/> to move.</param>
/// <param name="scale">The scale to change.</param>
public static void MoveNetworkIdentityObject(this Player player, NetworkIdentity identity, Vector3 scale)
Comment thread
NotZer0Two marked this conversation as resolved.
Outdated
{
identity.gameObject.transform.localPosition = scale;
Comment thread
NotZer0Two marked this conversation as resolved.
Outdated
ObjectDestroyMessage objectDestroyMessage = new()
{
netId = identity.netId,
};

player.Connection.Send(objectDestroyMessage, 0);
SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, player.Connection });
}

/// <summary>
/// Scales the object for all the players.
/// </summary>
/// <param name="identity">The <see cref="NetworkIdentity"/> to move.</param>
/// <param name="scale">The scale to change.</param>
public static void MoveNetworkIdentityObject(this NetworkIdentity identity, Vector3 scale)
Comment thread
NotZer0Two marked this conversation as resolved.
Outdated
{
identity.gameObject.transform.localPosition = scale;
Comment thread
NotZer0Two marked this conversation as resolved.
Outdated
ObjectDestroyMessage objectDestroyMessage = new()
{
netId = identity.netId,
};

foreach (Player ply in Player.List)
{
ply.Connection.Send(objectDestroyMessage, 0);
SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, ply.Connection });
}
}

/// <summary>
/// Send fake values to client's <see cref="SyncVarAttribute"/>.
/// </summary>
Expand Down