private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Stair")) { OnStairReached?.Invoke(); } }
protected override void Update() { base.Update(); #if UNITY_EDITOR if (debugMode && Input.GetKeyDown(KeyCode.Space)) { OnStairReached?.Invoke(); } #endif if (Input.GetMouseButtonDown(0) && _attackTimer <= 0 && GameManager.isPlaying) { var mousePos = Input.mousePosition; mousePos.z = GameManager.cam.nearClipPlane; var mouseWorldPos = GameManager.cam.ScreenToWorldPoint(mousePos); MainhandAttack(mouseWorldPos); _attackTimer = attackTime; } }