mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-06 00:39:55 +00:00
stupid rename
This commit is contained in:
parent
67313c8456
commit
ba83ed2276
@ -8,25 +8,25 @@ public static class IAuthWorldObject_Extensions
|
||||
/// <summary>
|
||||
/// try and gain authority over the object
|
||||
/// </summary>
|
||||
public static void RequestOwnership(this IAuthWorldObject authWorldObject)
|
||||
public static void RequestOwnership(this IAuthWorldObject @this)
|
||||
{
|
||||
if (authWorldObject.Owner != 0)
|
||||
if (@this.Owner != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
authWorldObject.SendMessage(new AuthWorldObjectMessage(QSBPlayerManager.LocalPlayerId));
|
||||
@this.SendMessage(new AuthWorldObjectMessage(QSBPlayerManager.LocalPlayerId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// release authority over the object,
|
||||
/// potentially to giving it to someone else
|
||||
/// </summary>
|
||||
public static void ReleaseOwnership(this IAuthWorldObject authWorldObject)
|
||||
public static void ReleaseOwnership(this IAuthWorldObject @this)
|
||||
{
|
||||
if (authWorldObject.Owner != QSBPlayerManager.LocalPlayerId)
|
||||
if (@this.Owner != QSBPlayerManager.LocalPlayerId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
authWorldObject.SendMessage(new AuthWorldObjectMessage(0));
|
||||
@this.SendMessage(new AuthWorldObjectMessage(0));
|
||||
}
|
||||
}
|
||||
|
@ -10,22 +10,22 @@ public static class ILinkedWorldObject_Extensions
|
||||
/// <summary>
|
||||
/// link a world object and a network behaviour
|
||||
/// </summary>
|
||||
public static void LinkTo(this ILinkedWorldObject<NetworkBehaviour> worldObject, ILinkedNetworkBehaviour networkBehaviour)
|
||||
public static void LinkTo(this ILinkedWorldObject<NetworkBehaviour> @this, ILinkedNetworkBehaviour networkBehaviour)
|
||||
{
|
||||
worldObject.SetNetworkBehaviour((NetworkBehaviour)networkBehaviour);
|
||||
networkBehaviour.SetWorldObject(worldObject);
|
||||
@this.SetNetworkBehaviour((NetworkBehaviour)networkBehaviour);
|
||||
networkBehaviour.SetWorldObject(@this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// link a world object and network object, then spawn it.
|
||||
/// (host only)
|
||||
/// </summary>
|
||||
public static void SpawnLinked(this ILinkedWorldObject<NetworkBehaviour> worldObject, GameObject prefab, bool spawnWithServerAuthority)
|
||||
public static void SpawnLinked(this ILinkedWorldObject<NetworkBehaviour> @this, GameObject prefab, bool spawnWithServerAuthority)
|
||||
{
|
||||
var go = Object.Instantiate(prefab);
|
||||
var networkBehaviour = go.GetComponent<ILinkedNetworkBehaviour>();
|
||||
|
||||
worldObject.LinkTo(networkBehaviour);
|
||||
@this.LinkTo(networkBehaviour);
|
||||
|
||||
if (spawnWithServerAuthority)
|
||||
{
|
||||
@ -41,6 +41,6 @@ public static class ILinkedWorldObject_Extensions
|
||||
/// wait for a world object to be linked.
|
||||
/// (non host only)
|
||||
/// </summary>
|
||||
public static async UniTask WaitForLink(this ILinkedWorldObject<NetworkBehaviour> worldObject, CancellationToken ct) =>
|
||||
await UniTask.WaitUntil(() => worldObject.NetworkBehaviour, cancellationToken: ct);
|
||||
public static async UniTask WaitForLink(this ILinkedWorldObject<NetworkBehaviour> @this, CancellationToken ct) =>
|
||||
await UniTask.WaitUntil(() => @this.NetworkBehaviour, cancellationToken: ct);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user