void Update() { if (active) { if (!hasOpened) { ChestOpen.SetActive(true); ChestClosed.SetActive(false); GameObject k = Instantiate(Key); k.transform.position = transform.position + new Vector3(0, 1, 0); k.transform.rotation = Quaternion.Euler(new Vector3(0, 90, 0)); Keyhole.correctKey = k; k.GetComponent <Key>().keyword = Keyhole.keyword; foreach (ButtonCompination BC in ToActivate) { BC.gameObject.SetActive(false); } hasOpened = true; } } else { CheckActives(); } }
//Draws the map to the screen public void Draw(RLConsole mapConsole, RLConsole statsConsole) { //For each cell that exists, set the symbol based on // logic provided in SetSymbolForCell foreach (Cell cell in GetAllCells()) { SetSymbolForCell(mapConsole, cell); } //Draws the stairs up StairsUp.Draw(mapConsole, this); //Draws the stairs down and instantiates the interactive // object StairsDown.Draw(mapConsole, this); //Draws the open chest ChestOpen.Draw(mapConsole, this); //Draws the closed chest and instantiates the interactive // object ChestClosed.Draw(mapConsole, this); int i = 0; foreach (Monster monster in _monsters) { monster.Draw(mapConsole, this); if (IsInFov(monster.X, monster.Y)) { monster.DrawStats(statsConsole, i); i++; } } }
void Start() { ChestClosed.SetActive(true); ChestOpen.SetActive(false); }