public void changeShootingDirection(int p) { Debug.Log("changing direction"); ShootingPosition = (Assets.Enums.ShootingPosition)p; switch (ShootingPosition) { case ShootingPosition.Left: Range = -BaseRange; break; case ShootingPosition.Right: Range = BaseRange; break; case ShootingPosition.Front: Range = BaseRange; break; case ShootingPosition.Back: Range = -BaseRange; break; } _activeCannonAmmount = GetCannonAmmountByShootingPosition(); _cannonOrientation = GetCannonOrientationByShootingPosition(); GenerateBulletPool(); }
// Use this for initialization void Start() { _renderer = GetComponent <Renderer>(); _shipHeight = _renderer.bounds.size.y; _shipWidth = _renderer.bounds.size.x; Range = BaseRange; if (ShootingPosition == ShootingPosition.Left || ShootingPosition == ShootingPosition.Back) { Range = -BaseRange; } _activeCannonAmmount = GetCannonAmmountByShootingPosition(); _cannonOrientation = GetCannonOrientationByShootingPosition(); GenerateBulletPool(); }