private void SpawnProjectile(Character.EFacingDirection direction) { Transform projTrans = GameManager.Instance.projectilePool.Spawn(); if (projTrans) { Projectile proj = projTrans.GetComponent <Projectile>(); proj.transform.position = Owner.transform.position; proj.DamageAuthor = Owner.gameObject; proj.damage = damage; proj.SetDirection(direction); } }
public void SetDirection(Character.EFacingDirection direction) { float angle = 0f; switch (direction) { case Character.EFacingDirection.Left: angle = 180f; break; case Character.EFacingDirection.Right: angle = 0f; break; case Character.EFacingDirection.Up: angle = 90f; break; } transform.rotation = Quaternion.Euler(0f, 0f, angle); }