Ejemplo n.º 1
0
            void EvaluateBarrel(GunBarrel barrel)
            {
                projectileSpawnPoints = barrel.projectileSpawnPoints;

                fireRate        += barrel.fireRate;
                projectileSpeed += barrel.muzzleVelocity;
                damage          += barrel.damage;
            }
Ejemplo n.º 2
0
            public void Evaluate(GunBody body, GunBarrel barrel,
                                 Projectile projectile)
            {
                fireRate        = 0;
                projectileSpeed = 0;
                damage          = 0;

                EvaluateBody(body);
                EvaluateBarrel(barrel);
                EvaluateProjectile(projectile);
            }
Ejemplo n.º 3
0
        void Awake()
        {
            player = GameManager.Instance.GetPlayerController();

            // instantiate body and barrel instances as children
            // and also replace the prefabs with the actual instances
            body   = Instantiate(body, transform) as GunBody;
            barrel = Instantiate(barrel, transform) as GunBarrel;

            stats = new EffectiveGunStats();
            stats.Evaluate(body, barrel, projectile);
        }