using UnityEngine;
using System.Collections;
using UnityEngine.Networking;
public class PrefabScript : NetworkBehaviour {
[SyncVar(hook="MakeTheChange")]
public Material material;
public Material newMaterial;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void MakeTheChange(Material value) {
GetComponent<MeshRenderer> ().material = value;
}
}
In the debugger, I can see MakeTheChange being called but value is alway null. Is there a limitation on what types can be synced? Any idea why value is null?