public void SetupTurretPanels(BuildingBase buildingBase)
    {
        ExitController exitController = FindObjectOfType <ExitController>();

        ClearList();
        int counter = -2;

        foreach (Turret turret in turrets)
        {
            RectTransform newDisplay = Instantiate(turretPanel, new Vector3(transform.position.x + turretPanelWidth * counter, transform.position.y, transform.position.z), Quaternion.identity, transform);
            TurretPanel   newPanel   = newDisplay.gameObject.GetComponentInChildren <TurretPanel>();

            newDisplay.transform.localPosition = new Vector3(turretPanelWidth * counter, 0, 0);
            turretPanels.Add(newPanel);

            newPanel.SetBuildingProperties(buildingBase, exitController);
            newPanel.SetTurret(turret);
            counter++;
        }
    }
예제 #2
0
    private void PlayerSpawner()
    {
        //Debug.Log("Spawning player...");
        GetRandomPos(_rootSubDungeon);                  // getting random position in the dungeon for the player
        Player.transform.position = _randomPos;
        _playerSpawnPos           = _randomPos;
        _objectSpawnPos[(int)_randomPos.x, (int)_randomPos.y] = 1;

        GetRandomPos(_rootSubDungeon);                  // getting random position in the dungeon for the exit
        _exitDoor = Instantiate(GameConfigData.Instance.ExitTile, new Vector3(_randomPos.x, _randomPos.y, 0f), Quaternion.identity).GetComponent <ExitController>();
        _exitDoor.transform.SetParent(Dungeon.transform);
        _exitDoor.GameManager = _gameManager;
        _objectSpawnPos[(int)_randomPos.x, (int)_randomPos.y] = 1;

        GetRandomPos(_rootSubDungeon);                  // getting random position in the dungeon for the object
        GameObject key = Instantiate(GameConfigData.Instance.Key, new Vector3(_randomPos.x, _randomPos.y, 0f), Quaternion.identity) as GameObject;

        key.transform.SetParent(Dungeon.transform);
        _objectSpawnPos[(int)_randomPos.x, (int)_randomPos.y] = 1;
        //Debug.Log("Player spawn ended.");
    }
예제 #3
0
 public static ExitController Fixture()
 {
     ExitController controller = new ExitController(new ExitRepository(), "", new LoginView());
     return controller;
 }
예제 #4
0
 void Start()
 {
     exitController         = GetComponent <ExitController>();
     exitController.onOpen += OnOpen;
 }
예제 #5
0
 public void SetBuildingProperties(BuildingBase buildingBase, ExitController exitController)
 {
     this.buildingBase   = buildingBase;
     this.exitController = exitController;
 }