Skip to content

Instantly share code, notes, and snippets.

@ronyx69
ronyx69 / ThemeDecals.cs
Last active August 21, 2017 13:12
Source code of the theme decals mod.
using ColossalFramework.Plugins;
using ColossalFramework.UI;
using ICities;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Xml.Serialization;
using UnityEngine;
namespace ThemeDecals
@ronyx69
ronyx69 / Realtime_NoUI.cs
Created August 26, 2017 19:07
Replaces textures/meshes for buildings/props/vehicles/trees ingame in realtime. (No User Interface)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using ICities;
using UnityEngine;
using ColossalFramework.IO;
using ObjUnity3D;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
using System.Text;
using System.Reflection;
using ICities;
using UnityEngine;
namespace LightEffects
// Custom Light Effects Scripts
// Adds custom light effects to props.
// Multiple effects can be added, including vanilla ones.
// The mod is not required to run the scripts or save the asset.
// It's only required for loading them.
@ronyx69
ronyx69 / Mods
Created November 24, 2017 17:31
List of the mods I have enabled.
Unlimited Money
Unlimited Oil And Ore
Unlock All
ModTools
Asset Prefab AI Changer
Toggle Asset Properties Panel
Asset Item Class Changer
Asset UICategory Changer
More Network Stuff
Prefab Hook
@ronyx69
ronyx69 / ColorVariations_AssetEditor.cs
Last active November 30, 2017 11:00
Sets color variations in asset editor.
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo; // BuildingInfo PropInfo VehicleInfo
var color1 = new Color32(255, 255, 255, 255);
var color2 = new Color32(255, 255, 255, 255);
var color3 = new Color32(255, 255, 255, 255);
var color4 = new Color32(255, 255, 255, 255);
asset.m_material.SetColor("_ColorV0", color1);
asset.m_material.SetColor("_ColorV1", color2);
@ronyx69
ronyx69 / PloppableAsphaltPlus_Props.cs
Last active January 5, 2018 12:10
For decal compatible ploppable asphalt + props. Tags props, disables ruining and automatically edits normals, scales mesh and paints vertices for main and LOD meshes.
// 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];
@ronyx69
ronyx69 / Vehicle_FloorParams.cs
Created June 10, 2017 17:53
Change floor parameters for Vehicle shaders in asset editor.
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as VehicleInfo;
var vec = new Vector4(0.0f, 5.0f, 0.0f, 0.0f); // (foundation, floor height, width, length)
asset.m_material.SetVector("_FloorParams", vec);
@ronyx69
ronyx69 / ChangeNetworkVariables_AssetEditor.cs
Last active April 4, 2018 14:59
Change various network variables in asset editor.
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as NetInfo;
// change half width
asset.m_halfWidth = 22.0f;
// enable create pavement
asset.m_createPavement = true;
// change the color of basic segment 0
@ronyx69
ronyx69 / NaturalResourceTexture.cs
Last active April 5, 2018 15:11
Imports a natural resource texture and applies the resource values to all cells on the map.
// Natural Resource Texture Importer
// Imports a natural resource texture and applies the resource values to all cells on the map.
// Texture name and location must be gamefolder/textures/res.png
// Resolution is 512x512
//
// Channel explanation:
// Default value for all channels is 128.
//
// Red (128-0) Oil (inverted)