public void OnTriggerEnter2D(Collider2D other) { // detect if collider is Player if (other.CompareTag("Player")) { if (!other.GetComponent <PlayerMovement>().InputIsLocked) { transitionManager.FadeToScene("DemoEnd"); other.GetComponent <PlayerMovement>().LockInput(exitDirection); } } }
private void Update() { if (!isHovering) { return; } if (Input.GetMouseButton(0)) { thumbnail.color = clickColor; title.color = clickColor; transitionManager.FadeToScene(levelDestination); return; } if (Input.GetMouseButtonUp(0)) { thumbnail.color = hoverColor; title.color = hoverColor; return; } }