void FireOrb(float angle) { Vector3 spawnPosition = transform.position; OrbMovement orbMovement = Instantiate(_orbPrefab, spawnPosition, Quaternion.identity, transform.parent).GetComponent <OrbMovement>(); orbMovement.MoveAtDirection( new Vector2( Mathf.Cos(angle), Mathf.Sin(angle) ) ); }
void Fire() { if (_audioSource != null) { _audioSource.Play(); } Vector2 fireDirection = GetAttackDirection(); Vector3 spawnPosition = transform.position + ((Vector3)fireDirection * .5f); OrbMovement orbMovement = Instantiate(_orbPrefab, spawnPosition, Quaternion.identity, transform.parent).GetComponent <OrbMovement>(); orbMovement.MoveAtDirection(fireDirection); }