22 lines
652 B
C#
22 lines
652 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.Netcode.Components;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Used for syncing a transform with client side changes. This includes host. Pure server as owner isn't supported by this. Please use NetworkTransform
|
|
/// for transforms that'll always be owned by the server.
|
|
/// </summary>
|
|
[DisallowMultipleComponent]
|
|
public class ClientNetworkTransform : NetworkTransform
|
|
{
|
|
public AuthorityMode authorityMode = AuthorityMode.Client;
|
|
|
|
protected override bool OnIsServerAuthoritative() => authorityMode == AuthorityMode.Server;
|
|
}
|
|
|
|
public enum AuthorityMode
|
|
{
|
|
Server,
|
|
Client
|
|
} |