Ejemplo n.º 1
0
    void checkEnemies()
    {
        SectorsManager smScript    = GameObject.FindGameObjectWithTag("sectorManager").GetComponent <SectorsManager>();
        int            secExplored = smScript.getExploredSector();

        /*if(!relocating && enemies.Count > 2){
         *      int toRelocate = Random.Range(0,enemies.Count);
         *      if(enemies[toRelocate].GetComponent<KamikazeEnemyScript>() != null){
         *              return;
         *      }
         *      enemies[toRelocate].GetComponent<BaseEnemy>().relocate();
         *      enemies.RemoveAt(toRelocate);
         *      relocating = true;
         * }*/
    }
Ejemplo n.º 2
0
/*	void checkExplored(){
 *              Vector3 playerPos = player.transform.position;
 *              int xVal = Mathf.FloorToInt((playerPos.x)/(unitSize)) + unitsValue/2;
 *              int yVal = Mathf.FloorToInt((playerPos.y)/(unitSize)) + unitsValue/2;
 *              if(explored[xVal,yVal] == false){
 *                      //Debug.Log("EXPLORED");
 *              }
 *              Destroy(fogs[xVal,yVal]);
 *              explored[xVal,yVal] = true;
 *      }*/
    void openMap()
    {
        if (!status)
        {
            status = true;

            Time.timeScale = 0;
            map.SetActive(true);

            Camera.main.orthographicSize = 6f;

            SectorsManager smScript     = GameObject.FindGameObjectWithTag("sectorManager").GetComponent <SectorsManager>();
            int            secExplored  = smScript.getExploredSector();
            Sector[]       sectorsArray = GameObject.FindGameObjectWithTag("sectorManager").GetComponentsInChildren <Sector>();
            float          val          = sectorsArray[secExplored].outerLimit;


            playerSprite.transform.localPosition = new Vector3(player.transform.position.x / mapWidth, player.transform.position.y / mapWidth, 1);
            playerSprite.transform.rotation      = player.transform.rotation;
        }
    }