private void animateClose() { if (count-- < intervalCount) { audioData.Play(0); Debug.Log(count / interval); gameObject.transform.GetChild((count) / (interval)).GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f); if (count != animationTime) { intervalCount -= interval; } } if (count == 0) { audioData.Play(0); animationOver = true; gameObject.GetComponent <BoxCollider2D>().isTrigger = false; player.SendMessage("DoorClosed"); cameraInstance.RefocusCamera(); } }
/// <summary> /// The rendering engine for the overworld. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnOverworldRender(object sender, UpdateEventArgs e) { // Don't bother redrawing all of the consoles if nothing has changed. if (_renderRequired) { mapConsole.Clear(); statConsole.Clear(); messageConsole.Clear(); inventoryConsole.Clear(); // Draw the map DungeonMap.Draw(mapConsole, statConsole); // Draw our player on the map subconsole Player.Draw(mapConsole, DungeonMap); // After we draw our player, draw our player's stats in the stats subconsole Player.DrawStats(statConsole); // Draw the player's inventory Player.DrawInventory(inventoryConsole); // Draw our message log MessageLog.Draw(messageConsole); // Refocus the camera CameraSystem.RefocusCamera(); // Blit the sub consoles to the root console in the correct locations RLConsole.Blit( statConsole, 0, 0, Dimensions.StatWidth, Dimensions.StatHeight, console, 0, 0 ); RLConsole.Blit( messageConsole, 0, 0, Dimensions.MessageWidth, Dimensions.MessageHeight, console, 0, Dimensions.ScreenHeight - Dimensions.MessageHeight ); RLConsole.Blit( inventoryConsole, 0, 0, Dimensions.InventoryWidth, Dimensions.InventoryHeight, console, Dimensions.MapWidth, 0 ); RLConsole.Blit( mapConsole, CameraSystem.ViewportStartX, CameraSystem.ViewportStartY, Dimensions.MapWidth, Dimensions.MapHeight, console, 0, Dimensions.StatHeight ); // Tell RLNET to draw the console that we set console.Draw(); } }