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
for (uint i = 0; i < PrefabCollection<CitizenInfo>.LoadedCount(); i++) { | |
var prefab = PrefabCollection<CitizenInfo>.GetLoaded(i); | |
if (prefab == null) continue; prefab.m_walkSpeed = 0.5f; } |
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
// Anim UV Scripts | |
// Create scrolling or multi-frame animations for vehicle sub meshes. | |
// Run in asset editor and see effects in real time. | |
// AnimUV Params Mod is not required for using the scripts and saving the asset. | |
// It's only needed to load the data in-game. | |
// Animated faces must be vertex painted black! The rest reimains white. |
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
// reminder: the y axis ingame represents height | |
// (as opposed to z, usually used in 3d software) | |
// copy vertex paint from prop to vehicle sub mesh | |
// vertex color explanation | |
// RED for blimps(visibility): 0 visible when spinning, 255 visible when stopped | |
// IDK what red will do on other vehicles |
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
var subMesh = 0; // sub mesh id, order as in ui, starting from 1 (0 is main mesh) | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as VehicleInfo; | |
// required and forbidden flags, use | to set multiple flags | |
asset.m_subMeshes[subMesh].m_vehicleFlagsRequired = Vehicle.Flags.Created | Vehicle.Flags.Flying; | |
asset.m_subMeshes[subMesh].m_vehicleFlagsForbidden = Vehicle.Flags.Reversed; | |
// parked flags | |
asset.m_subMeshes[subMesh].m_parkedFlagsRequired = VehicleParked.Flags.CustomName; |
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
var subMesh = 0; // sub mesh id, order as in ui, starting from 0 | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo; | |
// required and forbidden flags, use | to set multiple flags | |
asset.m_subMeshes[subMesh].m_flagsRequired = Building.Flags.Created | Building.Flags.Active; | |
asset.m_subMeshes[subMesh].m_flagsForbidden = Building.Flags.Abandoned; | |
// all building flags: | |
/* |
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
var subMesh = 1; // sub mesh id, order as in ui, starting from 1 | |
var shader = Shader.Find("Custom/Props/Prop/Default"); // the shader to use | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as VehicleInfo; | |
asset.m_subMeshes[subMesh].m_subInfo.m_material.shader = shader; | |
asset.m_subMeshes[subMesh].m_subInfo.m_lodMaterial.shader = shader; | |
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
var subMesh = 0; // sub mesh id, order as in ui, starting from 0 | |
var shader = Shader.Find("Custom/Props/Prop/Default"); // the shader to use | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo; | |
asset.m_subMeshes[subMesh].m_subInfo.m_material.shader = shader; | |
asset.m_subMeshes[subMesh].m_subInfo.m_lodMaterial.shader = shader; | |
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
//---------------------------------------------------------------- | |
// Tree Variation Amount Changer | |
// Set amount of Tree 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 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
// Tree Wind Sway Recalculator (Central) | |
// Recalculates vertex colors based on the proximity to center. | |
// Allows limiting sway with an adjustable multiplier. | |
var sway = 0.2f; // Sway multiplier 0.0 (none) to 1.0 (max) | |
var bias = 1.6f; // "Contrast" between center and outer parts, | |
// increasing this will make the middle more static, | |
// and the outside move more. |