Пример #1
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, transform, playerComponent) => {
         transform.position    = playerComponent.startPosition;
         transform.eulerAngles = playerComponent.startRotation;
     });
 }
Пример #2
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, transform, lineRenderer, lineRendererComponent) => {
         lineRendererComponent.lineRendererPointCount = 0;
         lineRenderer.numPositions = 0;
         Debug.Log("LineRendererCountDown");
     });
 }
Пример #3
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, countDownComponent) => {
         countDownComponent.myCountDownStatus = CountDownComponent.CountDownStatus.active;
         countDownComponent.timeElapsed       = 0;
         Time.timeScale = 1;
         egoComponent.gameObject.SetActive(true);
         Debug.Log("Countdown");
     });
 }
Пример #4
0
    void Handle(CountDownEvent e)
    {
        constraint.ForEachGameObject((egoComponent, mainMenuComponent) => {
            mainMenuComponent.myMenuStatus = MainMenuComponent.MenuStatus.inactive;
            egoComponent.gameObject.SetActive(false);
        });
        InitializeNewGameEvent newGame = new InitializeNewGameEvent();

        EgoEvents <InitializeNewGameEvent> .AddEvent(newGame);

        Debug.Log("started new game");
    }
Пример #5
0
    private IEnumerator Countdown()
    {
        while (startCountdown > 0)
        {
            CountDownEvent?.Invoke(startCountdown, false);
            yield return(new WaitForSecondsRealtime(1f));

            startCountdown--;
        }
        CountDownEvent?.Invoke(startCountdown, true);
        _isPlaying     = true;
        Time.timeScale = 1f;
    }
Пример #6
0
 public override void Update()
 {
     constraint.ForEachGameObject((egoComponent, mainMenuComponent) => {
         if (mainMenuComponent.myMenuStatus == MainMenuComponent.MenuStatus.active)
         {
             if (KutiInput.Instance.GetButtonDown(EKutiButton.P1Left) || KutiInput.Instance.GetButtonDown(EKutiButton.P1Up) || KutiInput.Instance.GetButtonDown(EKutiButton.P1Right) ||
                 KutiInput.Instance.GetButtonDown(EKutiButton.P2Left) || KutiInput.Instance.GetButtonDown(EKutiButton.P2Up) || KutiInput.Instance.GetButtonDown(EKutiButton.P2Right) || Input.anyKeyDown)
             {
                 var e = new CountDownEvent();
                 EgoEvents <CountDownEvent> .AddEvent(e);
                 Debug.Log("Countdown Event startet");
             }
         }
     });
 }
Пример #7
0
 public void SendEvent(CountDownEvent e)
 {
     if (e == CountDownEvent.ENDED)
     {
         if (waitingStartCountDown)
         {
             waitingStartCountDown = false;
             controllerCollection.SetCanMove(true);
             battleCountDown.StartCountDown(BattleTimer.SecondsInBattle);
         }
         else
         {
             controllerCollection.SetCanMove(false);
             SendEvent(BattleEvent.ENDED);
         }
     }
 }
Пример #8
0
 public override void FixedUpdate()
 {
     constraint.ForEachGameObject((egoComponent, transform, playerComponent) => {
         if (playerComponent.timeElapsed == -1)
         {
         }
         else if (playerComponent.timeElapsed >= 3)
         {
             var e = new CountDownEvent();
             EgoEvents <CountDownEvent> .AddEvent(e);
             playerComponent.timeElapsed = -1;
         }
         else
         {
             playerComponent.timeElapsed += Time.deltaTime;
         }
     });
 }
Пример #9
0
        public static void Main(string[] args)
        {
            //Class @class = new Class();
            //@class.Ces();

            //SelfDefineTaskSchedule_Test.DO();
            //ThreadPoolUnity.Do();
            //ThreadPoolUnity.Timer();
            //TaskUnity.Do();
            //TaskUnity.Do2();
            //TaskUnity.Do3();
            //TaskUnity.Do4();
            //ParallelUnity.DO();
            //ReaderWriterLockUnity.DO();
            CountDownEvent.DO();
            Console.Read();
            CreateWebHostBuilder(args).Build().Run();
        }
Пример #10
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, animation, player, spriteRenderer, collider, rb) => {
         spriteRenderer.sprite = animation.normalSprite;
     });
 }
Пример #11
0
 // Wrap the event in a protected virtual method
 // to enable derived classes to raise the event.
 protected virtual void RaiseCountDownEvent()
 {
     // Raise the event in a thread-safe manner using the ?. operator.
     CountDownEvent?.Invoke(this);
 }
Пример #12
0
 public byte[] Call(byte[] memento)
 {
     CountDownEvent.Wait();
     return(null);
 }
Пример #13
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, transform, rigidbdy, movement, player) => {
         movement.myFlyStatus = MovementComponent.FlyStatus.notFlying;
     });
 }
Пример #14
0
 public byte[] Call(byte[] memento)
 {
     StartEvent.Signal();
     CountDownEvent.Wait();
     return(null);
 }
Пример #15
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, gameOver) => {
         egoComponent.gameObject.SetActive(false);
     });
 }