componentsToDisable :
Code : Tout sélectionner
using UnityEngine;
using UnityEngine.Networking;
public class PlayerSetup : NetworkBehaviour {
[SerializeField]
Behaviour[] componentsToDisable;
private void Start()
{
if (!isLocalPlayer)
{
// boucle pour désactiver les components des autres joueurs sur notre instance
for(int i = 0; i < componentsToDisable.Length; i++)
{
componentsToDisable[i].enabled = false;
}
}
}
}