Esempio n. 1
0
        public override void HandleMsg(int msg_id, List <object> paramList)
        {
            if (msg_id == (int)MsgLib.TimePause)
            {
                TimeSwitch = false;
            }
            if (msg_id == (int)MsgLib.TimeStart)
            {
                TimeSwitch = true;
            }
            if (msg_id == (int)MsgLib.TimeForward)
            {
                TimeSwitch = true;
                timeCount  = timeUpdateTime;
            }
            if (msg_id == (int)MsgLib.TimeBackward)
            {
                TimeSwitch = true;
                timeCount  = 0;
                minute    -= timeUpdatePer;

                if (minute < 0)
                {
                    hour--;
                    minute = minuteLimit - timeUpdatePer;
                }

                if (hour < 0)
                {
                    week--;
                    hour = hourLimit - 1;
                }

                if (week < 1)
                {
                    year--;
                    week = weekLimit - 1;
                }

                UpdateTime();
            }
            if (msg_id == (int)MsgLib.TimeJump)
            {
                TimeSwitch = true;
                timeCount  = 0;

                hour   = 0;
                minute = 0;

                week++;
                if (week >= weekLimit)
                {
                    week = 1;
                    year++;
                }

                UpdateTime();
            }
            if (msg_id == (int)MsgLib.AddTimePoint && paramList != null)
            {
                for (int i = 0; i < paramList.Count; i++)
                {
                    AREvent arEvent = (AREvent)paramList[i];
                    AddEvent(arEvent);
                }
            }
            if (msg_id == (int)MsgLib.EventActionFinish)
            {
                NextAction();
            }
        }
Esempio n. 2
0
 private void AddEvent(AREvent arEvent)
 {
     Debug.Log(string.Format("事件名称 : {0}, 事件介绍 :{1}, 事件检查类型 : {2}, 事件时间点 : {3} - {4} - {5} - {6}", arEvent.EventName, arEvent.EventDesc, arEvent.CheckCondition, arEvent.CheckedTime.Year, arEvent.CheckedTime.Week, arEvent.CheckedTime.Hour, arEvent.CheckedTime.Minute));
     eventList.Add(arEvent);
 }