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