Ejemplo n.º 1
0
 void Start()
 {
     user = Data.Usuario;
     InvokeRepeating("Spawn", spawnTime, spawnTime);
     cam         = GameObject.FindGameObjectWithTag("MainCamera");
     webcam      = cam.GetComponent <WebCamScript>();
     audioSource = GetComponent <AudioSource>();
     escapeButton.onClick.AddListener(RunToMap);
     enemyAlive = numberOfEnemies;
 }
Ejemplo n.º 2
0
    void Awake()
    {
        user  = Data.Usuario;
        level = user.Lvl.Lvl;

        player       = GameObject.FindGameObjectWithTag("Player").transform;
        player2      = GameObject.FindGameObjectWithTag("Player");
        playerHealth = player2.GetComponent <PlayerHealth>();
        cam          = GameObject.FindGameObjectWithTag("MainCamera");
        webcam       = cam.GetComponent <WebCamScript>();

        nav = GetComponent <UnityEngine.AI.NavMeshAgent>();

        enemyManagerObject = GameObject.FindGameObjectWithTag("EnemyManager");
        enemyManager       = enemyManagerObject.GetComponent <EnemyManager>();

        maxEnemyHealth = enemyHealth * level * 0.7;
        enemyHealth    = maxEnemyHealth;
    }