Example #1
0
        public void ApplyDamage(ICannonBall cannonBall)
        {
            int damage = cannonBall.Damage - keel.DamageResistance;

            if (damage > 0)
            {
                Health -= damage;
            }
        }
        public IEnumerator Move(float speed, ITarget target, ICannonBall cannonBall)
        {
            this.target     = target;
            this.cannonBall = cannonBall;

            while (true)
            {
                transform.Translate(Vector3.up * Time.unscaledDeltaTime * speed, Space.Self);
                yield return(null);
            }
        }
 public void Shoot(CannonBallObject cannonBall, Transform shootTransform, ITarget target, ICannonBall ammo)
 {
     cannon.Shoot(cannonBall, shootTransform, target, ammo);
 }
 public float CheckAccuracy(ICannonBall cannonBall)
 {
     return(cannon.CheckAccuracy(cannonBall));
 }
        public void Shoot(CannonBallObject cannonBall, Transform shootTransform, ITarget target, ICannonBall ammo)
        {
            var objTransform        = shootTransform;
            var cannonBallTransform = cannonBall.transform;

            cannonBallTransform.position = objTransform.position;
            cannonBallTransform.rotation = objTransform.rotation;


            GameManager.Instance.StartCoroutine(cannonBall.GetComponent <CannonBallObject>().Move(ProjectileSpeed, target, ammo));
        }
 public float CheckAccuracy(ICannonBall cannonBall)
 {
     return(Accuracy * cannonBall.AccuracyModifier);
 }