Exemple #1
0
    //---------- Methods ----------
    public void InitializePlayerUnitGameObject(PlayerUnitData playerUnitData)
    {
        SetPlayerUnitData(playerUnitData);

        UnitSpawner.SetObjectName(gameObject);

        // Rank Indication
        RankIndicatorBar rankIndicatorBar = GetComponentInChildren <RankIndicatorBar>();

        rankIndicatorBar.Initialize(GetPlayerUnitData().GetRank());

        // Create range circle
        CreatePlayerUnitRangeCircle();
    }
    //---------- 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;
    }