Hi,
I have this script which uses a SyncListStruct with a callback.
It worked with Unity 5.4.1f1 but now with Unity 5.5.0f3 I get an error on the line:
destroyedTiles.Callback = OnDestroyMap;
Saying:
Assets/_Scripts/Map/MapNetwork.cs(29,29): error CS0123: A method or delegate MapNetwork.OnDestroyMap(UnityEngine.Networking.SyncList<bool>.Operation, int)' parameters do not match delegate UnityEngine.Networking.SyncList<MapNetwork.DestroyedTile>.SyncListChanged(UnityEngine.Networking.SyncList<MapNetwork.DestroyedTile>.Operation, int)’ parameters
Here is the code:
public class MapNetwork : NetworkBehaviour {
public struct DestroyedTile {
public int x;
public int y;
}
public class SyncListDestroyedTile : SyncListStruct {
}
private SyncListDestroyedTile destroyedTiles = new SyncListDestroyedTile();
public void Start(){
destroyedTiles.Callback = OnDestroyMap;
}
private void OnDestroyMap(SyncListBool.Operation op, int index){
DestroyTileOnClient (destroyedTiles[index].x, destroyedTiles[index].y);
}
}