private void OnVisit(ResBattleDynamicProperty InProperty) { uint dwID = InProperty.dwID; if (InProperty.bVarType == 1) { List <object> list; if (this._databin.ContainsKey(dwID)) { list = this._databin[dwID]; } else { list = new List <object>(); this._databin.Add(dwID, list); } list.Add(InProperty); } else if (InProperty.bVarType == 2) { DynamicProperty.UpdatePropertyList updatePropertyList; if (this._updateDatabin.ContainsKey(dwID)) { updatePropertyList = this._updateDatabin[dwID]; } else { updatePropertyList = new DynamicProperty.UpdatePropertyList(); updatePropertyList.deltaTime = 0u; updatePropertyList.propertyList = new List <object>(); this._updateDatabin.Add(dwID, updatePropertyList); } updatePropertyList.propertyList.Add(InProperty); } }
public void UpdateLogic(int delta) { this.m_frameTimer += (uint)delta; if (this.dynamicPropertyConfig == 0u || this._updateDatabin == null || !this._updateDatabin.ContainsKey(this.dynamicPropertyConfig) || !Singleton <BattleLogic> .GetInstance().isFighting) { return; } DynamicProperty.UpdatePropertyList updatePropertyList = this._updateDatabin[this.dynamicPropertyConfig]; for (int i = 0; i < updatePropertyList.propertyList.get_Count(); i++) { ResBattleDynamicProperty resBattleDynamicProperty = (ResBattleDynamicProperty)updatePropertyList.propertyList.get_Item(i); ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick; if (logicFrameTick < (ulong)resBattleDynamicProperty.dwVarPara1 || i == updatePropertyList.propertyList.get_Count() - 1) { updatePropertyList.deltaTime += (uint)(logicFrameTick - this.lastSystemTime); this.lastSystemTime = logicFrameTick; if (updatePropertyList.deltaTime >= resBattleDynamicProperty.dwVarPara2) { updatePropertyList.deltaTime -= resBattleDynamicProperty.dwVarPara2; this.UpdateActorProperty(ref resBattleDynamicProperty); } return; } } }