Example #1
0
        public void UpdateLogic(int delta)
        {
            this.m_frameTimer += (uint)delta;
            if (((this.dynamicPropertyConfig != 0) && (this._updateDatabin != null)) && (this._updateDatabin.ContainsKey(this.dynamicPropertyConfig) && Singleton <BattleLogic> .GetInstance().isFighting))
            {
                UpdatePropertyList list = this._updateDatabin[this.dynamicPropertyConfig];
                for (int i = 0; i < list.propertyList.Count; i++)
                {
                    ResBattleDynamicProperty property = (ResBattleDynamicProperty)list.propertyList[i];
                    ulong logicFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

                    if ((logicFrameTick < property.dwVarPara1) || (i == (list.propertyList.Count - 1)))
                    {
                        list.deltaTime     += (uint)(logicFrameTick - this.lastSystemTime);
                        this.lastSystemTime = logicFrameTick;
                        if (list.deltaTime >= property.dwVarPara2)
                        {
                            list.deltaTime -= property.dwVarPara2;
                            this.UpdateActorProperty(ref property);
                        }
                        return;
                    }
                }
            }
        }
Example #2
0
        private void OnVisit(ResBattleDynamicProperty InProperty)
        {
            uint dwID = InProperty.dwID;

            if (InProperty.bVarType == 1)
            {
                List <object> list = null;
                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)
            {
                UpdatePropertyList list2;
                if (this._updateDatabin.ContainsKey(dwID))
                {
                    list2 = this._updateDatabin[dwID];
                }
                else
                {
                    list2 = new UpdatePropertyList {
                        deltaTime    = 0,
                        propertyList = new List <object>()
                    };
                    this._updateDatabin.Add(dwID, list2);
                }
                list2.propertyList.Add(InProperty);
            }
        }