示例#1
0
        public void FireProjectile()
        {
            if (projectilePrefab == null || Time.time < cooldownTime)
            {
                return;
            }
            cooldownTime = Time.time + cooldownDuration;

            PlayFiringAnimation();

            GameObject instance = Instantiate(projectilePrefab,
                                              projectileOrigin.position,
                                              projectileOrigin.rotation);
            ProjectileBase projectile = instance.GetComponent <ProjectileBase>();

            if (projectile)
            {
                projectile.Setup(myTeamData);
            }
        }