Exemple #1
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, transform, playerComponent) => {
         transform.position    = playerComponent.startPosition;
         transform.eulerAngles = playerComponent.startRotation;
     });
 }
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, transform, lineRenderer, lineRendererComponent) => {
         lineRendererComponent.lineRendererPointCount = 0;
         lineRenderer.numPositions = 0;
         Debug.Log("LineRendererCountDown");
     });
 }
Exemple #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");
     });
 }
Exemple #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");
    }
Exemple #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;
    }
Exemple #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");
             }
         }
     });
 }
Exemple #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);
         }
     }
 }
Exemple #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;
         }
     });
 }
Exemple #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();
        }
Exemple #10
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, animation, player, spriteRenderer, collider, rb) => {
         spriteRenderer.sprite = animation.normalSprite;
     });
 }
 // 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);
 }
Exemple #12
0
 public byte[] Call(byte[] memento)
 {
     CountDownEvent.Wait();
     return(null);
 }
Exemple #13
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, transform, rigidbdy, movement, player) => {
         movement.myFlyStatus = MovementComponent.FlyStatus.notFlying;
     });
 }
Exemple #14
0
 public byte[] Call(byte[] memento)
 {
     StartEvent.Signal();
     CountDownEvent.Wait();
     return(null);
 }
Exemple #15
0
 void Handle(CountDownEvent e)
 {
     constraint.ForEachGameObject((egoComponent, gameOver) => {
         egoComponent.gameObject.SetActive(false);
     });
 }