23 lines
526 B
C#
23 lines
526 B
C#
using FishNet.Object;
|
|
|
|
public class NetworkedPlayerData : NetworkBehaviour
|
|
{
|
|
public string playerName;
|
|
public int level;
|
|
public int health;
|
|
|
|
public int maxHealth;
|
|
// Add other fields as necessary
|
|
|
|
public void InitializeFromScriptableObject(PlayerData data)
|
|
{
|
|
if (IsServer)
|
|
{
|
|
playerName = data.playerName;
|
|
level = data.level;
|
|
health = data.health;
|
|
maxHealth = data.maxHealth;
|
|
// Initialize other fields
|
|
}
|
|
}
|
|
} |