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 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 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 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 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 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; | |
namespace AnimUV | |
{ | |
public class AnimUVMod : LoadingExtensionBase, IUserMod |
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
Custom/Buildings/Building/AnimUV | |
Custom/Buildings/Building/Basement | |
Custom/Buildings/Building/Construction | |
Custom/Buildings/Building/Default | |
Custom/Buildings/Building/Fence | |
Custom/Buildings/Building/Floating | |
Custom/Buildings/Building/NoBase | |
Custom/Buildings/Building/Water | |
Custom/Buildings/Building/WaterFlow | |
Custom/Buildings/Building/WindTurbine |
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
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 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
// 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: | |
// |
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
// FlipXZ Script | |
// Tags a rotors shader vehicle sub mesh for Rotors FlipXZ mod. | |
var subMesh = 1; // vehicle sub mesh id, starting from 1 | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as VehicleInfo; | |
asset.m_subMeshes[subMesh].m_subInfo.m_UIPriority = 120122; | |
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 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; | |