34 lines
755 B
C#
34 lines
755 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Mirror;
|
|
|
|
public class ComponentsSync : NetworkBehaviour
|
|
{
|
|
public List<GameObject> objects;
|
|
public List<MonoBehaviour> scripts;
|
|
public List<SkinnedMeshRenderer> models;
|
|
|
|
void Start()
|
|
{
|
|
if (!isLocalPlayer)
|
|
{
|
|
foreach (var gameObject in objects)
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
foreach (var script in scripts)
|
|
{
|
|
script.enabled = false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
foreach (var model in models)
|
|
{
|
|
model.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
|
|
}
|
|
}
|
|
}
|
|
}
|