Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        // State
        state    = UnitState.IDLE;
        subState = UnitSubState.IDLE_STOPPED;

        // Stats
        getLevelByRound();
        generateStatsByLevel();
        currentHealthPoints = healthPoints;

        // Timers
        recoverTimerCount = recoverTimer;
        speedRecoverCount = speedRecoverRate;

        // Position
        patrolPosition = transform.position;

        // Unit UI
        unitUI.setName(unitName);
        unitUI.setLevel(level);
        unitUI.maxHealthPoints = healthPoints;
        unitUI.updateHealthPoints(currentHealthPoints);

        // Components
        Player        = GameObject.FindGameObjectWithTag("Player");
        navMeshAgent  = GetComponentInChildren <NavMeshAgent>();
        movementSpeed = navMeshAgent.speed;
    }