Skip to content

Instantly share code, notes, and snippets.

@ronyx69
ronyx69 / ThemeDecals_Script.cs
Last active April 12, 2017 21:51
Script for creating your own theme decals.
// You MUST use a unique diffuse texture (put whatever texture in it) to avoid unforeseen consequences!
// Import a decal or a big decal as usual and run this script using the texture tag you want:
//themedecal-grass
//themedecal-cliff
//themedecal-sand
//themedecal-gravel
//themedecal-ruined
//themedecal-oil
@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 / 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 / ThemeIngame.cs
Last active December 17, 2018 20:58
Change theme textures and colors ingame.
// scripts to change map theme textures, colors and other stuff ingame
// textures must be located in gamefolder/textures/
// also applies sharp textures mod default settings
// grass.png
if (File.Exists("textures/" + "grass.png")) { Texture2D texture2D = new Texture2D(1, 1);
texture2D.LoadImage(File.ReadAllBytes("textures/" + "grass.png"));
UnityEngine.Object.FindObjectOfType<TerrainProperties>().m_grassDiffuse = texture2D; }
TerrainManager.instance.m_properties.InitializeShaderProperties();
@ronyx69
ronyx69 / TransparentSelectors.cs
Last active September 13, 2020 21:41
Source code of the transparent selectors mod.
using ColossalFramework.IO;
using ColossalFramework.UI;
using ICities;
using System;
using System.IO;
using System.Reflection;
using System.Xml.Serialization;
using UnityEngine;
namespace TransparentSelectors
@ronyx69
ronyx69 / PropVariations_AssetEditor.cs
Last active November 29, 2020 07:25
Sets amount of prop variations and calculates equal probability.
//----------------------------------------------------------------
// 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
@ronyx69
ronyx69 / AnimUV_Mod.cs
Last active June 5, 2018 14:40
Source code for the AnimUV Params mod.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICities;
using UnityEngine;
namespace AnimUV
{
public class AnimUVMod : LoadingExtensionBase, IUserMod
@ronyx69
ronyx69 / AnimUV_Scripts.cs
Last active April 10, 2023 12:33
Scripts for saving AnimUV params in props. (Added modless shader parameter saving method by boformer.)
// Anim UV Scripts
// Create scrolling or multi-frame animations for props.
// Run in asset editor and see effects in real time.
// Animated faces must be vertex painted black! The rest reimains white.
// Shades of gray animate slower, don't use unless you know what you're doing.
// Google how to do vertex color painting in your 3d software of choice!
@ronyx69
ronyx69 / WindTurbine_Scripts.cs
Last active July 4, 2018 07:33
Change parameters for the WindTurbine shader in asset editor or preview ingame.
// Wind Turbine Scripts
// Control wind turbine pivot, rotation mode, blade speed.
// Use the wind turbine template when importing!
// Vertex Colors
// Parts of the mesh must be vertex painted accordingly:
//
@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);