Ejemplo n.º 1
0
        public static ArrowProjectile Create(Vector3 position, Enemy enemyTarget, int damageAmount, float moveSpeed)
        {
            Transform arrowProjectileTransform = Instantiate(GameAssets.Instance.pfArrowProjectile, position, Quaternion.identity);

            ArrowProjectile arrowProjectile = arrowProjectileTransform.GetComponent <ArrowProjectile>();

            arrowProjectile.Initialize(enemyTarget, damageAmount, moveSpeed);

            return(arrowProjectile);
        }
Ejemplo n.º 2
0
        private void HandleShooting()
        {
            m_shootTimer -= Time.deltaTime;

            if (m_shootTimer <= 0f)
            {
                m_shootTimer += m_shootTimerMax;

                if (m_targetEnemy != null)
                {
                    ArrowProjectile.Create(m_projectileSpawnPosition, m_targetEnemy, m_damageAmount, m_moveSpeed);
                }
            }
        }