private void Arrange_TimeEvent(TimeEvent timeEvent)
 => _pos.TimeObserver.OnNext(timeEvent);
Esempio n. 2
0
 public void Update()
 {
     TimeEvent?.Invoke(this, EventArgs.Empty);
 }
    public override void ApplyEvent(TimeEvent timeEvent, bool reverse)
    {
        RotationEvent newEvent = (RotationEvent)timeEvent;

        target.rotation = newEvent.rotation;
    }
Esempio n. 4
0
 /// <summary>
 /// 任务调用 毫秒
 /// </summary>
 /// <param name="task"></param>
 /// <param name="delay"></param>
 /// <returns></returns>
 public int Schedule(TimeEvent task, long delay)
 {
     GameFW.Utility.Tools.debuger.Log("启用了一个任务, 延时为 : " + delay);
     return(ScheduleTicks(task, delay * 10000));//1tick为100毫微秒(10^-7),1毫秒为10^-3
 }
 public void DBPUpdate(float currentDpressure, float FinalDpressure, DateTime EndTime, TimeEvent currentEvent)
 {
     DBPUpdateStartTime = DateTime.Now;
     DBPUpdateEndTime   = EndTime;
     BPDInitial         = currentDpressure;
     BPDFinal           = FinalDpressure;
     DPrate             = (FinalDpressure - currentDpressure) / (float)(EndTime - DateTime.Now).TotalMilliseconds;
     UpdateDBP          = true;
     currentDBPEvent    = currentEvent;
 }
Esempio n. 6
0
 // StartStopwatch - Starts the Stopwatch coroutine.
 public void StartStopwatch(TimeEvent timer)
 {
     timer.routine = StartCoroutine(Stopwatch(timer));
 }
Esempio n. 7
0
    public void Reset()
    {
        var evt = new TimeEvent(TimeEventType.AmbientLighting);

        GameSystems.TimeEvent.Schedule(evt, 1, out _);
    }
 public void AddPublicEvent(TimeEvent timeEvent)
 {
     events.Enqueue(timeEvent);
 }
Esempio n. 9
0
 public void ExecutePastEvent(TimeEvent timeEvent)
 {
 }
Esempio n. 10
0
 //Таким образом заполняется последовательность
 public void AddEvent(TimeEvent tEvent)
 {
     sequence.Add (tEvent);
 }
 void HandlePublicEvents()
 {
     while (events.Count > 0)
     {
         TimeEvent  tevent       = events.Peek();
         GameObject go           = tevent.go;
         bool       eventHandled = false;
         if (go.GetComponent <HumanController>() != null) //human event called
         {
             Human human = go.GetComponent <HumanController>().human;
             if (tevent.timeEvent.type == TimeManager.EventType.Created)
             {
                 //Debug.Log(human.ToString() + " born");
                 AddHiddenEvent(EventType.childBorn);
                 eventHandled = true;
             }
             else if (tevent.timeEvent.type == TimeManager.EventType.End)
             {
                 tevent.go.GetComponent <HumanController>().Die(true);
                 Debug.Log(human.ToString() + " died");
                 eventHandled = true;
                 //Destroy(go);
             }
             else if (tevent.timeEvent.type == TimeManager.EventType.Error)
             {
                 Debug.LogError(human.ToString() + " error occured");
                 eventHandled = true;
             }
             else if (tevent.timeEvent.type == TimeManager.EventType.AgeZoneUp)
             {
                 human._ageZone = (Human.AgeZone)((int)human._ageZone + 1);
                 if (GameController.instance.gameManager.currentTime._time > new TimeManager.YearMonth(0, 1))
                 {
                     human._age._go.GetComponent <AudioSource>().PlayOneShot(GameController.instance.ageChange);
                 }
                 eventHandled = true;
             }
             else if (tevent.timeEvent.type == TimeManager.EventType.TaskCompleted)
             {
                 human._taskDone  = true;
                 human.multiplier = human._age.multiplier;
                 eventHandled     = true;
             }
         }
         else if (go.GetComponent <GameController>() != null) //main time event called
         {
             if (tevent.timeEvent.type == TimeManager.EventType.Created)
             {
                 //Debug.Log("Game Started");
                 eventHandled = true;
             }
         }
         else if (go == null)
         {
             Debug.LogError("game object missing");
             eventHandled = false;
         }
         else if (go.GetComponent <ResourceController>() != null)  //resource event called
         {
             if (tevent.timeEvent.type == TimeManager.EventType.Created)
             {
                 eventHandled = true;
             }
         }
         else if (go.GetComponent <BuildingController>() != null)  //building event called
         {
             if (tevent.timeEvent.type == TimeManager.EventType.Created)
             {
                 eventHandled = true;
             }
             else if (tevent.timeEvent.type == TimeManager.EventType.TaskCompleted)
             {
                 tevent.go.GetComponent <BuildingController>().building._taskDone = true;
                 eventHandled = true;
             }
         }
         //event handled or not, it will be removed
         if (eventHandled == false)
         {
             Debug.LogError("Event not handled: EventHandler: " + tevent.ToString());
         }
         events.Dequeue();
     }
 }
Esempio n. 12
0
    public void OperateAction(int pos, int timer = 15)
    {
        if (mTimeEvent != null)
        {
            mTimeEvent.Reset();
        }

        if (!GameMgr.Instance.isFromRecord)
        {
            mTimeEvent = TimerMgr.instance.Subscribe(timer, false, TimeEventType.IngoreTimeScale).OnUpdate(x =>
            {
                mTimer.text = string.Format("{0}", x.surplusTimeRound);

                //******控制时间哒哒哒播放 start
                if (!isPlayTimeAlarm && UIWindowMgr.Instance.mCurrPage.CacheGo.name != "UISingleSettlementWindow(Clone)" &&
                    UIWindowMgr.Instance.mCurrPage.CacheGo.name != "UIGameSettlementWindow(Clone)")
                {
                    if (mTimer.text == "5")
                    {
                        isPlayTimeAlarm = true;
                        //开始播放
                        MahjongAudioMgr.Instance.PlayTimeDaDaDa();
                    }
                }
                else
                {
                    if (mTimer.text == "15" || mTimer.text == "0")
                    {
                        isPlayTimeAlarm = false;
                        MahjongAudioMgr.Instance.StopTimeDaDaDa();
                    }
                }
                //******控制时间哒哒哒播放 end
            }).Start();
        }



        if (pos == 0)
        {
            mEastTweenAlpha.gameObject.SetVisible(true);
            mSouthTweenAlpha.gameObject.SetVisible(false);
            mWestTweenAlpha.gameObject.SetVisible(false);
            mNorthTweenAlpha.gameObject.SetVisible(false);
        }
        else if (pos == 1)
        {
            mEastTweenAlpha.gameObject.SetVisible(false);
            mSouthTweenAlpha.gameObject.SetVisible(true);
            mWestTweenAlpha.gameObject.SetVisible(false);
            mNorthTweenAlpha.gameObject.SetVisible(false);
        }
        else if (pos == 2)
        {
            mEastTweenAlpha.gameObject.SetVisible(false);
            mSouthTweenAlpha.gameObject.SetVisible(false);
            mWestTweenAlpha.gameObject.SetVisible(true);
            mNorthTweenAlpha.gameObject.SetVisible(false);
        }
        else if (pos == 3)
        {
            mEastTweenAlpha.gameObject.SetVisible(false);
            mSouthTweenAlpha.gameObject.SetVisible(false);
            mWestTweenAlpha.gameObject.SetVisible(false);
            mNorthTweenAlpha.gameObject.SetVisible(true);
        }
    }
Esempio n. 13
0
 /// <summary>
 /// 任务调用毫秒
 /// </summary>
 /// <param name="task"></param>
 /// <param name="delay"></param>
 /// <returns></returns>
 public int schedule(TimeEvent task, long delay)
 {
     return(schedulemms(task, delay * 1000 * 1000));
 }
Esempio n. 14
0
 public static void RemoveTimeEvent(this MonoBehaviour mono, TimeEvent model)
 {
     EventMgr.Ins.RemoveTimeEvent(model);
 }
Esempio n. 15
0
 private void stopScoring(TimeEvent.OnTimePassed evendData)
 {
     Debug.Log("Will Stop scoring");
     canScore = false;
     eventBus.Publish (new EndGameEvent.OnEndGame(totalScore >= scoreTarget));
 }
 // Add event
 public void addEvent(TimeEvent newEvent)
 {
     events.Add (newEvent);
 }
Esempio n. 17
0
 /// <summary>
 /// 任务调用  毫秒
 /// </summary>
 /// <param name="task"></param>
 /// <param name="delay"></param>
 /// <returns></returns>
 public int Schedule(TimeEvent task, long delay)
 {
     //毫秒转微秒
     return(Schedulemms(task, delay * 10000000));
 }
Esempio n. 18
0
 public void Close()
 {
     viewGameobject.SetActive(false);
     CloseCallBack();
     deleteTimer = GlobalTimeRequest.AddDelayTime(5, DestroySelf);
 }
Esempio n. 19
0
 //Отправиться в прошлое
 //Так игрок отправляется в прошлое
 IEnumerator Restart(Vector2 location)
 {
     TimeEvent tEvent = new TimeEvent(timer, location,"Return");
     SetChronology (chronology.chronology.Count-1, tEvent);
     Serializator.SaveXml(chronology, datapath);
     mainCharacter.gameObject.GetComponent<CharacterController> ().SetReturning ();
     yield return new WaitForSeconds (0.5f);
     Application.LoadLevel (Application.loadedLevel);
 }
Esempio n. 20
0
 public void AddTimeEvent(TimeEvent te)
 {
     TimeEvents.Add(te);
 }
Esempio n. 21
0
 public void ExpireAmbientLighting(TimeEvent evt)
 {
     GameSystems.LightScheme.SetHourOfDay(12);
     GameSystems.TimeEvent.RemoveAll(TimeEventType.AmbientLighting);
 }
 // Invokes the event
 private void OnRaiseTimeEvent(TimeEventArgs e) =>
 TimeEvent?.Invoke(this, e);
Esempio n. 23
0
 // simply prints the event name to the debug log, subclasses will implement this
 public virtual void HandleTimeEvent(TimeEvent te)
 {
     Debug.Log(te.evtType + te.factor.ToString() + te.startTime.ToString());
 }
Esempio n. 24
0
 public TimeEvent( TimeEvent _src )
 {
     m_Trigger = new TimeTrigger( _src.m_Trigger ) ;
 }
 public void SBPUpdate(float currentSpressure, float FinalSpressure, DateTime EndTime, TimeEvent currentEvent)
 {
     SBPUpdateStartTime = DateTime.Now;
     SBPUpdateEndTime   = EndTime;
     BPSInitial         = currentSpressure;
     BPSFinal           = FinalSpressure;
     SPrate             = (FinalSpressure - currentSpressure) / (float)(EndTime - DateTime.Now).TotalMilliseconds;
     UpdateSBP          = true;
     currentSBPEvent    = currentEvent;
 }
Esempio n. 26
0
 public TimeTaskModel(int id, TimeEvent task, long time)
 {
     this.task = task;
     this.Id   = id;
     this.Time = time;
 }
Esempio n. 27
0
 public static int AddTimeEventEx(this MonoBehaviour mono, TimeEvent model)
 {
     return(EventMgr.Ins.AddTimeEvent(model));
 }
    public void RestartCheckNetworkCfg(TimeEvent progressEvent)
    {
        ServerPcListener serverPcListener = FindObjectsOfType <ServerPcListener>()[0];

        serverPcListener.RestartCheckNetworkCfg(progressEvent, interactiveSprite);
    }
Esempio n. 29
0
 public void OnTimeEvent(TimeEvent te)
 => _registeredMartys.ForEach(mart => mart.OnTimeEvent(te));
    public void RestartAntiMalwareScan(TimeEvent progressEvent)
    {
        ServerPcListener serverPcListener = FindObjectsOfType <ServerPcListener>()[0];

        serverPcListener.RestartAntiMalwareScan(progressEvent, interactiveSprite);
    }
Esempio n. 31
0
 // Add event
 public void addEvent(TimeEvent newEvent)
 {
     events.Add(newEvent);
 }
Esempio n. 32
0
 void OnTimerTick(TimeEvent timeEvent)
 {
     CurrentTimeValue = (int)User.EventScheduler.RemainingTimeOfEventWithTag(LifeTimerTag);
     DelegateLifeTimerUpdated();
 }
Esempio n. 33
0
 public TimeTaskModel(int id, TimeEvent execut, long time)
 {
     this.id     = id;
     this.execut = execut;
     this.time   = time;
 }
Esempio n. 34
0
 public void Add(TimeEvent e)
 {
     // TODO: sort
     timedEvents.AddLast(e);
 }
 //Функция записи нового действия, совершённого персонажем
 /*void SwitchColMode(bool controlled)//Необходимый костыль для преодоления неподконтрольными персонажами препятствий
 {
     if (!controlled)
     {
         controlCol.GetComponent<BoxCollider2D>().enabled=false;
         uncontrolCol.GetComponent<BoxCollider2D>().enabled=true;
         uncontrolCol.GetComponent<CircleCollider2D>().enabled=true;
     }
     else
     {
         controlCol.GetComponent<BoxCollider2D>().enabled=true;
         uncontrolCol.GetComponent<BoxCollider2D>().enabled=false;
         uncontrolCol.GetComponent<CircleCollider2D>().enabled=false;
     }
 }*/
 public void WriteChronology(string action)
 {
     //prevTime=lvlController.timer;//отсутствие этой строки обеспечивает независимость списка перемен скоростей и списка действий
     TimeEvent tEvent= new TimeEvent (lvlController.timer,VectorConverter(transform.position),action);
     lvlController.SetChronology(number, tEvent);
     actionNumber++;
 }
Esempio n. 36
0
 // Start - Use this for initialization.
 void Start()
 {
     GameMaster.sequence.StartSequence(this);
     packet = new TimeEvent(time, () => { Debug.Log("Tester " + nickname + " finished!"); });
     TimeManager.CreateTimer().StartStopwatch(packet);
 }
Esempio n. 37
0
        public override void Init()
        {
            tra = transform;

            forwardAni = new TimeEvent(delay, () => {
                if (tra is RectTransform)
                {
                    RectTransform rectTra      = tra as RectTransform;
                    rectTra.anchoredPosition3D = pFrom;
                    rectTra.anchoredPosition3D.ChangeVaule(pTo, duration, (v) => rectTra.anchoredPosition3D = v, curve, ignoreTime,
                                                           () => {
                        currentCount--;
                        currentCount = currentCount < 0 ? 0 : currentCount;
                        if (onForwardFinish != null)
                        {
                            onForwardFinish.Invoke();
                        }
                    });

                    return;
                }
                tra.localPosition = pFrom;
                tra.localPosition.ChangeVaule(pTo, duration, (v) => tra.localPosition = v, curve, ignoreTime,
                                              () => {
                    currentCount--;
                    currentCount = currentCount < 0 ? 0 : currentCount;
                    if (onForwardFinish != null)
                    {
                        onForwardFinish.Invoke();
                    }
                });

                if (first && loopCount != 1)
                {
                    first = false;
                    forwardAni.waitTime = delay + duration;
                }
            }, ignoreTime, null, loopCount, true);

            reverseAni = new TimeEvent(delay, () => {
                if (tra is RectTransform)
                {
                    RectTransform rectTra      = tra as RectTransform;
                    rectTra.anchoredPosition3D = pTo;
                    rectTra.anchoredPosition3D.ChangeVaule(pFrom, duration, (v) => rectTra.anchoredPosition3D = v, curve, ignoreTime,
                                                           () => {
                        currentCount--;
                        currentCount = currentCount < 0 ? 0 : currentCount;
                        if (onReverseFinish != null)
                        {
                            onReverseFinish.Invoke();
                        }
                    });

                    return;
                }

                tra.localPosition = pTo;
                tra.localPosition.ChangeVaule(pFrom, duration, (v) => tra.localPosition = v, curve, ignoreTime,
                                              () => {
                    currentCount--;
                    currentCount = currentCount < 0 ? 0 : currentCount;
                    if (onReverseFinish != null)
                    {
                        onReverseFinish.Invoke();
                    }
                });

                if (first && loopCount != 1)
                {
                    first = false;
                    forwardAni.waitTime = delay + duration;
                }
            }, ignoreTime, null, loopCount, true);

            if (autoPlay)
            {
                PlayFroward();
            }
        }
Esempio n. 38
0
 //Так записывается хронология
 public void SetChronology(int number, TimeEvent tEvent)
 {
     chronology.chronology [number].AddEvent (tEvent);
 }