protected void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player") && player.GetPlayerState() == ObjectWithFlick.PlayerState.PLAYER_STATE_JUMP_DOWN) { player.SetIfOnBlock(true); } }
private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { unlimitedJump = !unlimitedJump; } if ((player.GetPlayerState() == ObjectWithFlick.PlayerState.PLAYER_STATE_IDLE || player.GetPlayerState() == ObjectWithFlick.PlayerState.PLAYER_STATE_TAP || unlimitedJump) && !player.GetIfGameOver()) { if (Application.isEditor || Application.platform == RuntimePlatform.WindowsPlayer) { if (Input.GetMouseButtonDown(0)) { OnDragStart(); } else if (Input.GetMouseButtonUp(0)) { OnDragEnd(); } else { OnDrag(); } } else { if (Input.touchCount > 0) { Touch touch = Input.GetTouch(0); switch (touch.phase) { case TouchPhase.Began: OnDragStart(); break; case TouchPhase.Moved: OnDrag(); break; case TouchPhase.Ended: OnDragEnd(); break; } } } } }