예제 #1
0
        private void StartBallMovement()
        {
            var direction  = _startingDirections[Random.Range(0, _startingDirections.Count)];
            var forceEvent = new AddForceEvent(direction, StartingBallForce);

            EventManager.Instance.TriggerEvent(forceEvent);
        }
예제 #2
0
        private void AddForce(AddForceEvent addForceEvent)
        {
            var forceVector = addForceEvent.Direction.normalized * addForceEvent.Amount;

            _rigidbody.velocity = Vector3.zero;

            _rigidbody.AddForce(forceVector, ForceMode.Impulse);
        }