在开发城市模式:Skylines时,我遇到了一个问题.
据我所知,我的大多数代码都可以正常工作 - 但到目前为止,我还没有对它进行测试.这是因为当我添加到UI的按钮被点击时,它应该按顺序被调用.此按钮上的单击事件不会调用我已分配给它的处理程序.
这是我创建按钮的地方:
public class LoadingExtension : LoadingExtensionBase
{
public override void OnLevelLoaded(LoadMode mode)
{
Debug.LogDebugMessage("Adding 'Generate City Report' button to UI");
// Get the UIView object. This seems to be the top-level object for most
// of the UI.
var uiView = UIView.GetAView();
// Add a new button to the view.
var button = (UIButton)uiView.AddUIComponent(typeof(UIButton));
// Set the text to show on the button.
button.text = "Generate City Report";
// Set the button dimensions.
button.width = 250; …
Run Code Online (Sandbox Code Playgroud) 我正在为城市的四季Mod:Skylines工作.我的方式很好,我找到了一种方法,通过使用将地面纹理改为雪地纹理
mat.SetTexture("_TerrainGrassDiffuse", grassTexture);
Run Code Online (Sandbox Code Playgroud)
所以这很好,但我不希望季节之间有一个难切.所以我提出了这个想法:在雪和草纹理之间徘徊.谷歌搜索很多,但我没有提出任何有用的东西.所以我想要一个在雪纹理中消失的lerp,并在一定的时间内淡化草纹理,所以我认为lerp就在这里.我没有访问着色器,导致它的mod,我需要反编译..我尝试使用
someMat.Lerp();
但我不知道我需要为someMat使用哪种材料.感谢帮助!