private void Start() { InitComponent(); _gameState = EGameState.PlayerWait; _timingBarPointerDirection = ETimingBarDirection.Right; _timingBarPointerSpeed = TimingBarPointerInitialSpeed; _isJumpSuccess = false; _mainCam = Camera.main; StartGame(); }
void UpdateTimingBarPointerDirection() { Vector2 mPointerPosition = _timingBarPointerTransform.anchoredPosition; Rect mBackRect = _timingBarBackTransform.rect; if (mPointerPosition.x < mBackRect.xMin) { mPointerPosition.x = mBackRect.xMin; _timingBarPointerTransform.anchoredPosition = mPointerPosition; _timingBarPointerDirection = ETimingBarDirection.Right; _isJumpSuccess = false; } else if (mPointerPosition.x > mBackRect.xMax) { mPointerPosition.x = mBackRect.xMax; _timingBarPointerTransform.anchoredPosition = mPointerPosition; _timingBarPointerDirection = ETimingBarDirection.Left; _isJumpSuccess = false; } }