public NwkSyncableData sub(iNwkSync sync) { if (hasBroad(sync)) { Debug.LogError("already has that sync ? " + sync); return(null); } // at this point the generated IID is not final, it can be overritten just after sub (if copy) NwkSyncableData data = sync.getData(); if (data != null) { broadcasters.Add(data); //on sub l'objet que si c'est un objet local if (data.syncNwkClientUID == NwkClient.nwkUid) { frequencers.Add(data); } Debug.Log("sub '" + sync + "' to syncer"); } else { Debug.LogWarning(sync + " was not sub to syncer ?"); } return(data); }
protected NwkSyncableData solveUnknownData(int cUID, int oIID, int oPID) { GameObject copy = factoryDb.copy(oPID); if (copy == null) { Debug.LogWarning("no copy possible with PID : " + oPID); return(null); } copy.name += oIID.ToString(); Debug.Log(Time.frameCount + " => copy ? " + copy); //find ref of component of that sync in newly created object NwkSyncableData curSyncData = null; iNwkSync sync = filterSyncableOnInstance(copy, factoryDb.items[oPID].type); if (sync == null) { Debug.LogError("no sync found in copy ?"); return(null); } //forcing object to generate it's data curSyncData = sync.getData(); //but won't have owner info yet, so we need to inject id info here //inject none-local stuff curSyncData.overrideData(cUID, oIID, oPID); Debug.Log(Time.frameCount + " => data ? " + curSyncData); bubbleSyncableToListeners(copy, sync); return(curSyncData); }