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)); } }
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; } }
private void MouseDown() { DownEvent?.Invoke(); }