예제 #1
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (DownEvent != null)
     {
         DownEvent.Invoke(Slot);
     }
 }
        private async Task SendDownNotifications()
        {
            while (true)
            {
                await Task.Delay(_random.Next(3000));

                Application.Current.Dispatcher?.Invoke(() => DownEvent?.Invoke(this, EventArgs.Empty));
            }
        }
예제 #3
0
 void Jumping()
 {
     if (isGround && Input.GetKeyDown(KeyCode.Space))//Start Jumping
     {
         isJumping       = true;
         jumpTimeCounter = jumpTime;
         rb.velocity     = Vector3.up * jumpVelocity;
         isGround        = false;
         if (JumpEvent != null)
         {
             JumpEvent.Invoke();
         }
     }
     if (Input.GetKey(KeyCode.Space) && isJumping) //Jumping
     {
         if (jumpTimeCounter > 0)                  //Jumping Time didn't end
         {
             rb.velocity      = Vector3.up * jumpVelocity;
             jumpTimeCounter -= Time.deltaTime;
         }
         else//Jumping Time Ended
         {
             if (DownEvent != null)
             {
                 DownEvent.Invoke();
             }
             isJumping = false;
             isDown    = true;
         }
     }
     if (Input.GetKeyUp(KeyCode.Space))//End Jump (getkeyUP)
     {
         if (DownEvent != null)
         {
             DownEvent.Invoke();
         }
         isJumping = false;
         isDown    = true;
     }
     if ((camera.transform.position.z - transform.position.z) <= zDistance)
     {
         isDown = false;
     }
 }
예제 #4
0
 private void MouseDown()
 {
     DownEvent?.Invoke();
 }