void GetLocalData(InputDataBase playerInputData) { TrueSyncInput.CurrentInputData = (InputData) playerInputData; if (behaviorsByPlayer.ContainsKey(playerInputData.ownerID)) { List<TrueSyncManagedBehaviour> managedBehavioursByPlayer = behaviorsByPlayer[playerInputData.ownerID]; for (int index = 0, length = managedBehavioursByPlayer.Count; index < length; index++) { TrueSyncManagedBehaviour bh = managedBehavioursByPlayer[index]; if (bh != null && !bh.disabled) { bh.OnSyncedInput(); } } } TrueSyncInput.CurrentInputData = null; }
private void GetLocalData(InputData i_PlayerInputData) { ///////////////////////////////////////////////////////////////////////////// // This is to skip the second unnecessary call when synced windows is 0. // Bug already reported to Jeff. // This condition should never trigger when sync window is greater than 0. ///////////////////////////////////////////////////////////////////////////// if (m_LastGetLocalDataTick == ticks) { return; } // Cahce current tick. m_LastGetLocalDataTick = ticks; ///////////////////////////////////////////////////////////////////////////// TrueSyncInput.CurrentInputData = i_PlayerInputData; // Synced input on player behaviours. List <TrueSyncManagedBehaviour> tsmbList = null; if (m_BehavioursPerPlayer.TryGetValue(i_PlayerInputData.ownerID, out tsmbList)) { for (int index = 0; index < tsmbList.Count; ++index) { TrueSyncManagedBehaviour tsmb = tsmbList[index]; if (tsmb == null || tsmb.disabled) { continue; } tsmb.OnSyncedInput(); } } TrueSyncInput.CurrentInputData = null; }