This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Script to set lane props. Replaces all lane props! | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as NetInfo; var ai = asset.m_netAI as RoadAI; | |
List<NetLaneProps.Prop>[] basic = new List<NetLaneProps.Prop>[asset.m_lanes.Length]; | |
for (int i = 0; i < basic.Length; i++) basic[i] = new List<NetLaneProps.Prop>(); | |
var elevatedLanes = 0; | |
if(ai.m_elevatedInfo != null) if(ai.m_elevatedInfo.m_lanes != null) if(ai.m_elevatedInfo.m_lanes.Length != 0) elevatedLanes = ai.m_elevatedInfo.m_lanes.Length; | |
List<NetLaneProps.Prop>[] elevated = new List<NetLaneProps.Prop>[elevatedLanes]; | |
for (int i = 0; i < elevated.Length; i++) elevated[i] = new List<NetLaneProps.Prop>(); | |
var bridgeLanes = 0; | |
if(ai.m_bridgeInfo != null) if(ai.m_bridgeInfo.m_lanes != null) if(ai.m_bridgeInfo.m_lanes.Length != 0) bridgeLanes = ai.m_bridgeInfo.m_lanes.Length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// m_parkingSpaces | |
// Sets the amount, type, flags, direction and position of parking spaces for props. | |
// I haven't tested or researched this at all. | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo; | |
var parkingSpaces = 1; // amount of parking spaces | |
PropInfo.ParkingSpace[] temp = new PropInfo.ParkingSpace[parkingSpaces]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// m_specialPlaces (SittingDown) | |
// Sets the amount, direction and position of sitting places for benches. | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo; | |
var specialPlaces = 1; // amount of sitting positions | |
PropInfo.SpecialPlace[] temp = new PropInfo.SpecialPlace[specialPlaces]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------------- | |
// Prop Variation Amount Changer | |
//Set amount of prop variations. | |
//If you are increasing the amount, previous variations will be preserved. | |
//If decreasing, all variations will be removed! | |
var variations = 12; //CHANGE THIS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Building (and Building Sub Mesh) Anim UV Scripts | |
// Create scrolling or multi-frame animations for buildings. | |
// Run in asset editor and see effects in real time. | |
// Ingame the building might require electricity to animate. | |
// No mods required, the changes save and load in vanilla. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var prefabNames = new List<string>(); | |
for (uint i = 0; i < PrefabCollection<NetInfo>.LoadedCount(); i++) | |
{ | |
var prefab = PrefabCollection<NetInfo>.GetLoaded(i); | |
if (prefab == null) continue; | |
Debug.Log(prefab); | |
prefabNames.Add(prefab.ToString()); | |
} | |
prefabNames.Sort(); | |
var s="\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ColossalFramework.IO; | |
using ColossalFramework.UI; | |
using ICities; | |
using System; | |
using System.IO; | |
using System.Reflection; | |
using System.Xml.Serialization; | |
using UnityEngine; | |
namespace TransparentSelectors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Action<string, string> ReplaceProp = (search, replace) => | |
{ | |
var replacementProp = PrefabCollection<PropInfo>.FindLoaded(replace); | |
for (uint i = 0; i < PrefabCollection<NetInfo>.LoadedCount(); i++) | |
{ | |
var prefab = PrefabCollection<NetInfo>.GetLoaded(i); | |
if (prefab == null) continue; | |
if(prefab.m_lanes != null) foreach (var Lane in prefab.m_lanes) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Network segment and node reorder scripts. Refreshes UI automatically. | |
// SEGMENTS | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as NetInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo; | |
var off = 15.0f; // amount of hours the light is turned off during the day (15 max) (0 means always on) | |
var random = 0.3f; // adds randomness to time lights turn on/off, if 0 then all lights turn on/off at the same time | |
asset.m_illuminationOffRange.x = 6*Convert.ToSingle(Math.Pow(Convert.ToDouble((6-off/2.5)/6), Convert.ToDouble(1/1.09))); | |
asset.m_illuminationOffRange.y = Mathf.Clamp(6*Convert.ToSingle(Math.Pow(Convert.ToDouble((6-off/2.5)/6), Convert.ToDouble(1/1.09)))-random, 0, 6); |