Пример #1
0
    //---------- Methods ----------
    public void InitializeEnemyUnitGameObject(EnemyUnitData enemyUnitData, float initialHealth)
    {
        SetEnemyUnitData(enemyUnitData);
        this.currentHealth  = initialHealth;
        this.currentShields = enemyUnitData.GetMaxShields();

        UnitSpawner.SetObjectName(gameObject);
        if (enemyUnitData.GetEnemyType() == EnemyType.NORMAL)
        {
            SetNormalEnemyColor();
        }

        // Attach select unit circle to this game object
        Transform enemyUnitCircle = transform.GetChild(0);

        selectedUnitCircle = enemyUnitCircle;
    }
Пример #2
0
    public List <string> GetDisplayUnitData()
    {
        List <string> unitData = new List <string>();

        string displayName     = "Enemy: " + enemyUnitData.GetDisplayName();
        string health          = "Health: " + currentHealth + " / " + enemyUnitData.GetMaxHealth();
        string armor           = "Armor: " + enemyUnitData.GetArmor();
        string shields         = "Shields: " + currentShields + " / " + enemyUnitData.GetMaxShields();
        string shieldRegenRate = "Shield Regeneration Rate: " + enemyUnitData.GetShieldRegenerationRate();
        string level           = "Level: " + enemyUnitData.GetLevel();
        string movementSpeed   = "Movement Speed: " + enemyUnitData.GetMovementSpeed();
        string enemyType       = "Enemy Type: " + Utils.CleanEnumString(enemyUnitData.GetEnemyType().ToString());

        unitData.Add(displayName);
        unitData.Add(health);
        unitData.Add(armor);
        if (enemyUnitData.GetEnemyType() == EnemyType.NORMAL)
        {
            unitData.Add(movementSpeed);
            unitData.Add(level);
        }
        else if (enemyUnitData.GetEnemyType() == EnemyType.BOUNTY)
        {
            unitData.Add(movementSpeed);
        }
        else if (enemyUnitData.GetEnemyType() == EnemyType.BONUS)
        {
            unitData.Add(shields);
            unitData.Add(shieldRegenRate);
        }
        else if (enemyUnitData.GetEnemyType() == EnemyType.BOSS)
        {
            unitData.Add(movementSpeed);
            unitData.Add(shields);
            unitData.Add(shieldRegenRate);
        }
        unitData.Add(enemyType);

        return(unitData);
    }