Пример #1
0
    void SetUpPlayerStats()
    {
        HealthBehavior playerHealth = GameObject.FindObjectOfType <PlayerBehaviour>().GetComponent <HealthBehavior>();

        playerHealth.SetMaxHealth(10);
        playerHealth.SetDefenseValue(0);
        playerHealth.GetComponent <OffenseBehavior>().SetAttackPower(1);
    }
    private void PrimeNewEnemy()
    {
        enemyOffenseStats = enemy.GetComponent <OffenseBehavior>();
        enemyOffenseStats.SetAttackPower(enemyOffenseStats.GetAttackPower());

        enemyHealthStats = enemy.GetComponent <HealthBehavior>();
        enemyHealthStats.SetMaxHealth(enemyHealthStats.maxHealth);

        enemyAi = enemy.GetComponent <EnemyBehaviour>();
        enemyAi.SetAttackRate(enemyAi.attackRateInSeconds);
        enemyAi.ResetEnemy();
    }
    private void PrimeNewEnemy()
    {
        enemyOffenseStats = enemy.GetComponent <OffenseBehavior>();
        enemyOffenseStats.SetAttackPower(enemyOffenseStats.GetAttackPower() + multiplier);

        enemyHealthStats = enemy.GetComponent <HealthBehavior>();
        enemyHealthStats.SetMaxHealth(enemyHealthStats.maxHealth * multiplier);
        enemyHealthStats.SetDefenseValue(enemyHealthStats.GetDefenseValue() + multiplier);

        enemyAi = enemy.GetComponent <EnemyBehaviour>();
        //enemyAi.SetAttackRate(enemyAi.attackRateInSeconds);
        enemyAi.winningsValue *= multiplier;
        pendingWinnings        = enemy.GetComponent <EnemyBehaviour>().winningsValue;

        multiplier = (enemyPool.enemyIndex + 1) * difficultyScale;
    }
 public void SetMaxHealth(int amount)
 {
     myHealth.SetMaxHealth(amount);
 }