- Home /
Question by
Zoelovezle · Jan 09, 2016 at 01:47 AM ·
unity 5networkingscript errorsynchronizationbug report
SyncListStruct Unity Error
According this Unity Manual , it says that SyncListStruct supports array .
But when i try using anytype of array even int[] , it throws following error :
On Server/Host :
InvalidProgramException: Invalid IL code in Example/SyncListmyArray:SerializeItem
(UnityEngine.Networking.NetworkWriter,SyncListmyArray/MultiArrayStruct): IL_001f: call 0x0a000016
On Client : SyncList not initialized
Otherwise its works without errors .
My Script :
public struct MultiArray
{
public int pow;
public float f;
public int[] meow ;
}
public class SyncListMultiArray : SyncListStruct<MultiArray>
{
}
public SyncListMultiArray hellow = new SyncListMultiArray();
void AddME() {
var myInt = new int[5];
for (int i = 0; i < myInt.Length; i++) {
myInt [i] = i;
}
var _myVar = new MultiArray{ pow = 1, f = 1.4f, meow = myInt } ;
hellow.Add (_myVar);
}
Comment