private void OnCollisionEnter(Collision collision) { if (collision.transform.CompareTag("Ball")) { if (isBoss) { BossPower--; if (BossPower <= 0) { GetComponent <MeshCollider>().enabled = false; GetComponent <MeshRenderer>().enabled = false; } } else { GetComponent <MeshCollider>().enabled = false; GetComponent <MeshRenderer>().enabled = false; } Destroy(collision.gameObject); if (onHitHandler != null) { onHitHandler.Invoke(this); } } }
// Update is called once per frame void Update() { if (isHovering) { if (clicking) { onHoverClick.Invoke(currentPosition, currentButton); if (clickStart) { onHoverClickStart.Invoke(currentPosition, currentButton); } if (longClickStart) { onHoverLongClickStart.Invoke(currentPosition, currentButton); } if (longClicking) { onHoverLongClick.Invoke(currentPosition, currentButton); } } else { if (clickEnd) { onHoverClickEnd.Invoke(currentPosition, currentButton); } if (longClickEnd) { onHoverLongClickEnd.Invoke(currentPosition, currentButton); } if (quickClickEnd) { onHoverQuickClickEnd.Invoke(currentPosition, currentButton); } if (doubleClickEnd) { onHoverDoubleClickEnd.Invoke(currentPosition, currentButton); } } } //reset variables currentButton = null; currentPosition = EasyInputConstants.NOT_VALID; isHovering = false; clickStart = false; clicking = false; clickEnd = false; longClicking = false; longClickStart = false; longClickEnd = false; quickClickEnd = false; doubleClickEnd = false; }
public override void HoverExit(Vector3 hitPosition, Transform pointerTransform) { onHoverExit.Invoke(hitPosition); }
public override void HoverExit(Vector3 hitPosition) { onHoverExit.Invoke(hitPosition); }
public override void HoverEnter(Vector3 hitPosition) { onHoverEnter.Invoke(hitPosition); }