This file contains hidden or 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 System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using ICities; | |
| using UnityEngine; | |
| using System.Reflection; | |
| using System.Runtime.InteropServices; | |
| using System.Threading; | |
| using System.Xml.Serialization; |
This file contains hidden or 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 hidden or 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
| // Ploppable Apshalt + (RoadBridge) used for asphalt and pavement. | |
| // Automatic normal editing, mesh scaling and vertex painting for main and LOD meshes. | |
| // Also removes ruining, and tags as ploppable asphalt prop. | |
| var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo; | |
| asset.m_UIPriority = 0; // Set your UI priority! | |
| var triangles = asset.m_mesh.triangles; | |
| int[] triangleArray = new int[triangles.Length]; |
This file contains hidden or 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 System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using UnityEngine; | |
| using System.IO; | |
| using ColossalFramework.IO; | |
| using ObjUnity3D; | |
| using ICities; |
This file contains hidden or 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
| //scripts to use with the Realtime mod, filename must match file prefix in import folder | |
| var type="building"; | |
| var filename="thing"; var assetname="thing"; | |
| Type.GetType("Realtime.RealtimeMod").GetMethod(type).Invoke(null, new object[] { filename, assetname }); | |
| var type="prop"; | |
| var filename="snow1"; var assetname="snow1"; | |
| Type.GetType("Realtime.RealtimeMod").GetMethod(type).Invoke(null, new object[] { filename, assetname }); |
This file contains hidden or 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 System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.IO; | |
| using ICities; | |
| using UnityEngine; | |
| using ColossalFramework.IO; | |
| using ObjUnity3D; |
This file contains hidden or 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
| // Textures must be placed in gamefolder/textures/props | |
| // For example if my prop file name is snow1 and asset name is also snow1, | |
| // then the textures would be called snow1.snow1_Data_d.png | |
| // snow1.snow1_Data_a.png, snow1.snow1_Data_n.png and so on... | |
| var assetname = "snow1.snow1_Data"; // CHANGE ONLY THIS | |
| var asset = PrefabCollection<PropInfo>.FindLoaded(assetname); | |
| var assetMaterial = asset.m_material; var texturePath = " "; | |
| Texture2D providedTexture=null; Color px; |
This file contains hidden or 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 ICities; | |
| using System; | |
| using System.Reflection; | |
| using UnityEngine; | |
| namespace LightingRebalance | |
| { | |
| public class LightingRebalanceMod : LoadingExtensionBase, IUserMod | |
| { | |
| public string Name | |
| { |
This file contains hidden or 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 | |
| var shader = Shader.Find("Custom/Buildings/Building/Floating"); | |
| var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo; | |
| if(asset.m_material != null) asset.m_material.shader = shader; | |
| if(asset.m_lodMaterial != null) asset.m_lodMaterial.shader = shader; | |
| //prop |
This file contains hidden or 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
| // PropMesh To NetworkMesh | |
| var propName = "Barrels"; | |
| var networkName = "Train Track"; | |
| var type = "segment"; // segment or node | |
| var id = 1; | |
| var replaceTexture = false; // true or false | |
| var prop = PrefabCollection<PropInfo>.FindLoaded(propName); // PropInfo, BuildingInfo, VehicleInfo, TreeInfo |