public static void SetFallof(int FallofId, float Rotation) { if (LastFallofId == FallofId && LastRotation == Rotation) { return; } BrushGenerator.Current.Brushes[FallofId].wrapMode = TextureWrapMode.Clamp; BrushGenerator.Current.Brushes[FallofId].mipMapBias = -1f; BrushGenerator.Current.Brushes[FallofId].filterMode = FilterMode.Bilinear; BrushGenerator.Current.Brushes[FallofId].anisoLevel = 2; if (Rotation == 0) { BrushGenerator.Current.RotatedBrush = BrushGenerator.Current.Brushes[FallofId]; } else { BrushGenerator.Current.RotatedBrush = BrushGenerator.rotateTexture(BrushGenerator.Current.Brushes[FallofId], Rotation); } LastFallofId = FallofId; LastRotation = Rotation; RegeneratePaintBrushIfNeeded(true); }
public void UpdateMenu(bool Slider = false) { if (Slider) { } else { } Min = BrushMini.value / ScmapEditor.Current.Data.size.y; Max = BrushMax.value / ScmapEditor.Current.Data.size.y; Min /= 10f; Max /= 10f; if (LastRotation != BrushRotation.intValue) { LastRotation = BrushRotation.intValue; if (LastRotation == 0) { BrushGenerator.Current.RotatedBrush = BrushGenerator.Current.Brushes[SelectedFalloff]; } else { BrushGenerator.Current.RotatedBrush = BrushGenerator.rotateTexture(BrushGenerator.Current.Brushes[SelectedFalloff], LastRotation); } TerrainMaterial.SetTexture("_BrushTex", (Texture)BrushGenerator.Current.RotatedBrush); BrushGenerator.RegeneratePaintBrushIfNeeded(true); } }
public void ChangeFalloff(int id) { SelectedFalloff = id; BrushGenerator.Current.Brushes[SelectedFalloff].wrapMode = TextureWrapMode.Clamp; BrushGenerator.Current.Brushes[SelectedFalloff].mipMapBias = -1f; BrushGenerator.Current.Brushes[SelectedFalloff].filterMode = FilterMode.Bilinear; BrushGenerator.Current.Brushes[SelectedFalloff].anisoLevel = 2; LastRotation = BrushRotation.intValue; if (LastRotation == 0) { BrushGenerator.Current.RotatedBrush = BrushGenerator.Current.Brushes[SelectedFalloff]; } else { BrushGenerator.Current.RotatedBrush = BrushGenerator.rotateTexture(BrushGenerator.Current.Brushes[SelectedFalloff], LastRotation); } TerrainMaterial.SetTexture("_BrushTex", (Texture)BrushGenerator.Current.RotatedBrush); BrushGenerator.RegeneratePaintBrushIfNeeded(true); }