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 trees = TreeManager.instance.m_trees.m_buffer; | |
| for (uint i = 0; i < trees.Length; i++) | |
| { | |
| var data = trees[i]; | |
| if (data.m_flags == (ushort)TreeInstance.Flags.None || data.Info == null) continue; | |
| byte density; | |
| NaturalResourceManager.instance.CheckForest(data.Position, out density); | |
| double randomValue = Math.Round(UnityEngine.Random.value * 100, 0, MidpointRounding.AwayFromZero); | |
| if (randomValue <= density || density == 0) | |
| { |
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
| [Serializable] | |
| public class SerializableColor | |
| { | |
| public float r; | |
| public float g; | |
| public float b; | |
| public float a; |
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 info = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo; | |
| info.m_mesh.name = "MrMaison_CloudMod"; |
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 audioClipList = new List<string>(); | |
| var audioClips = Resources.FindObjectsOfTypeAll<AudioClip>(); | |
| for (uint i = 0; i < audioClips.Length; i++) | |
| { | |
| var audioClip = audioClips[i]; | |
| if (audioClip == null) continue; | |
| Debug.Log(audioClip); | |
| audioClipList.Add(audioClip.ToString()); | |
| } | |
| audioClipList.Sort(); |
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 propsList = new List<string>(); | |
| var props = Resources.FindObjectsOfTypeAll<PropInfo>(); | |
| for (uint i = 0; i < props.Length; i++) | |
| { | |
| var prop = props[i]; | |
| if (prop == null || !prop.m_isDecal) continue; | |
| prop. | |
| Debug.Log(prop); | |
| propsList.Add(prop.ToString() + ". Category: " + prop.category + ". Class: " + prop.m_class + ". Name: " + prop.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
| var renderersList = new List<string>(); | |
| var renderers = Resources.FindObjectsOfTypeAll<Renderer>(); | |
| for (uint i = 0; i < renderers.Length; i++) | |
| { | |
| var renderer = renderers[i]; | |
| if (renderer == null) continue; | |
| Debug.Log(renderer.ToString()); | |
| renderersList.Add(renderer.ToString() + ". Material: " + renderer.material.ToString() + ". Materials: " + renderer.materials.ToString() + ". Name: " + renderer.name.ToString()); | |
| } | |
| renderersList.Sort(); |
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 propsList = new List<string>(); | |
| var props = Resources.FindObjectsOfTypeAll<PropInfo>(); | |
| for (uint i = 0; i < props.Length; i++) | |
| { | |
| var prop = props[i]; | |
| if (prop == null) continue; | |
| Debug.Log(prop); | |
| propsList.Add(prop.ToString() + ". Category: " + prop.category + ". Class: " + prop.m_class + ". Name: " + prop.name); | |
| } | |
| propsList.Sort(); |
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 ColossalFramework.IO; | |
| using ColossalFramework.Plugins; | |
| using ColossalFramework.UI; | |
| using ICities; | |
| using System; | |
| using System.IO; | |
| using System.Reflection; | |
| using System.Xml.Serialization; | |
| using UnityEngine; |
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
| public static void LoadAllShaders() | |
| { | |
| var path1 = Path.Combine(DataLocation.localApplicationData, "sunshaftsshader"); | |
| var path2 = Path.Combine(DataLocation.localApplicationData, "simpleclearshader"); | |
| var loadBundleRequest = WWW.LoadFromCacheOrDownload(Path.Combine("file://", path1), 0); | |
| var loadedBundle = loadBundleRequest?.assetBundle; | |
| var loadAssetsRequest = loadedBundle.LoadAsset("SunShaftsComposite.shader", typeof(GameObject)); | |
| SimpleClearShader.shader = loadAssetsRequest as Shader; | |
| Instantiate(SimpleClearShader.shader); | |
| loadedBundle.Unload(false); |
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 shaderList = new List<string>(); | |
| var shaders = Resources.FindObjectsOfTypeAll<Shader>(); | |
| for (uint i = 0; i < shaders.Length; i++) | |
| { | |
| var shader = shaders[i]; | |
| if (shader == null) continue; | |
| Debug.Log(shader); | |
| shaderList.Add(shader.ToString()); | |
| } | |
| shaderList.Sort(); |