Beispiel #1
0
        /// <summary>
        /// Use to set a rooms gas after the round has started, otherwise do it in the initialisation
        /// </summary>
        /// <param name="roomNumber">Room number to fill</param>
        /// <param name="gasMixToUse">GasMix to fill room with</param>
        public void SetRoomGas(int roomNumber, GasMix gasMixToUse)
        {
            var bounds = metaTileMap.GetLocalBounds();

            foreach (Vector3Int position in bounds.allPositionsWithin())
            {
                MetaDataNode node = metaDataLayer.Get(position, false);
                if (node.IsRoom && node.RoomNumber == roomNumber)
                {
                    //Use ChangeGasMix to remove old gas overlays and add new overlays
                    node.ChangeGasMix(GasMix.NewGasMix(gasMixToUse));
                }
            }
        }