Ejemplo n.º 1
0
    public void SetBackgroundImage()
    {
        BattleBackground battleBackground = FindObjectOfType <BattleBackground>();

        if (mapSquare)
        {
            battleBackground.SetImage(mapSquare.GetLocationImage());
        }
        else
        {
            battleBackground.SetImage(Resources.Load <Sprite>("LocationImages/City/Location1"));
        }
    }
    public void InitializeMenu(MapSquare newSquare)
    {
        gameObject.SetActive(true);
        square = newSquare;

        locationImage = square.GetLocationImage();

        Image[] images = GetComponentsInChildren <Image>();
        foreach (Image image in images)
        {
            switch (image.name)
            {
            case "LocationImageContent":
                image.sprite = locationImage;
                break;
            }
        }

        poiMenu.SetupButtons(square.GetMapObjects());
        hackMenu.SetupButtons(square.GetHackTargets());

        UpdateEffectsButton();
    }
    public void InitializeMenu(MapSquare mapSquare)
    {
        gameObject.SetActive(true);
        square          = mapSquare;
        locationImage   = square.GetLocationImage();
        hackTargets     = square.GetHackTargets();
        mapObjects      = square.GetMapObjects();
        poiScoutLevel   = square.GetPOIScoutLevel();
        enemyScoutLevel = square.GetEnemyScoutLevel();

        Image[] images = GetComponentsInChildren <Image>();
        foreach (Image image in images)
        {
            switch (image.name)
            {
            case "LocationImageContent":
                image.sprite = locationImage;
                break;
            }
        }

        enemy = mapSquare.GetEnemy();

        if (enemy != null || enemyScoutLevel == 1)
        {
            enemyInfo.SetupEnemyInfo(enemy, square, enemyScoutLevel);
        }
        else if (enemy == null && enemyScoutLevel == 3 || enemy == null && enemyScoutLevel == 2)
        {
            enemyInfo.SetupEmptyEnemy(square);
        }

        SetupHackTargets();
        CheckIsPlayerAdjacent();
        UpdateEffectsButton();
    }