Esempio n. 1
0
        void ChangeMoney(params object[] args)
        {
            L_Attribute att = m_AttributeRoot.FindChild("money");

            att.Value = (int)att.Value + (int)args[0];
            GameEventMachine.SendEvent(GameEventID.Event_2UI_ChangeMoney, att.Value, (int)args[0]);
        }
Esempio n. 2
0
        /// <summary>
        /// 每一秒固定增长的钱的数量
        /// </summary>
        void PreAddMoney()
        {
            // 增加的进步数量(计算公式?)
            int increment = 1;
            //
            L_Attribute att = m_AttributeRoot.FindChild("money");

            att.Value = (int)att.Value + increment;

            // 通知UI钱的数量发生了改变
            GameEventMachine.SendEvent(GameEventID.Event_2UI_ChangeMoney, att.Value, increment);
            // 平均每秒调用一次
            ClockMachine.It.CreateClock(1, PreAddMoney);
        }