public override void Register(){ Undo.RegisterMarkersDelete = true; Textures = new ScmapEditor.TerrainTexture(); i = Undo.UndoData_StratumId; Textures.Albedo = Undo.Current.Scmap.Textures [i].Albedo; Textures.AlbedoPath = Undo.Current.Scmap.Textures [i].AlbedoPath; Textures.AlbedoScale = Undo.Current.Scmap.Textures [i].AlbedoScale; Textures.Normal = Undo.Current.Scmap.Textures [i].Normal; Textures.NormalPath = Undo.Current.Scmap.Textures [i].NormalPath; Textures.NormalScale = Undo.Current.Scmap.Textures [i].NormalScale; Textures.Tilling = Undo.Current.Scmap.Textures [i].Tilling; }
public override void Register() { Undo.RegisterMarkersDelete = true; Textures = new ScmapEditor.TerrainTexture(); i = Undo.UndoData_StratumId; Textures.Albedo = Undo.Current.Scmap.Textures [i].Albedo; Textures.AlbedoPath = Undo.Current.Scmap.Textures [i].AlbedoPath; Textures.AlbedoScale = Undo.Current.Scmap.Textures [i].AlbedoScale; Textures.Normal = Undo.Current.Scmap.Textures [i].Normal; Textures.NormalPath = Undo.Current.Scmap.Textures [i].NormalPath; Textures.NormalScale = Undo.Current.Scmap.Textures [i].NormalScale; Textures.Tilling = Undo.Current.Scmap.Textures [i].Tilling; }
public override void Register(HistoryParameter Param) { UndoCommandName = "Stratum change"; parameter = (Param as StratumChangeHistoryParameter); Textures = new ScmapEditor.TerrainTexture(); i = parameter.StratumId; Textures.Albedo = ScmapEditor.Current.Textures[i].Albedo; Textures.AlbedoPath = ScmapEditor.Current.Textures[i].AlbedoPath; Textures.AlbedoScale = ScmapEditor.Current.Textures[i].AlbedoScale; Textures.Normal = ScmapEditor.Current.Textures[i].Normal; Textures.NormalPath = ScmapEditor.Current.Textures[i].NormalPath; Textures.NormalScale = ScmapEditor.Current.Textures[i].NormalScale; Textures.Tilling = ScmapEditor.Current.Textures[i].Tilling; }
public void SwitchLayers(int FromLayer, int ToLayer) { Color[] StratumData = GetPixels(FromLayer); if (FromLayer > 4 != ToLayer > 4) { // Different tex Color[] StratumDataPrev = GetPixels(ToLayer); for (int i = 0; i < StratumData.Length; i++) { float from = GetChannelByLayer(ToLayer, StratumDataPrev[i]); SetChannelByLayer(ToLayer, ref StratumDataPrev[i], GetChannelByLayer(FromLayer, StratumData[i])); SetChannelByLayer(FromLayer, ref StratumData[i], from); } SetPixels(FromLayer, StratumData); SetPixels(ToLayer, StratumDataPrev); } else { // Same for (int i = 0; i < StratumData.Length; i++) { float from = GetChannelByLayer(ToLayer, StratumData[i]); SetChannelByLayer(ToLayer, ref StratumData[i], GetChannelByLayer(FromLayer, StratumData[i])); SetChannelByLayer(FromLayer, ref StratumData[i], from); } SetPixels(ToLayer, StratumData); } ScmapEditor.TerrainTexture Prev = ScmapEditor.Current.Textures[FromLayer]; ScmapEditor.Current.Textures[FromLayer] = ScmapEditor.Current.Textures[ToLayer]; ScmapEditor.Current.Textures[ToLayer] = Prev; ScmapEditor.Current.SetTextures(FromLayer); ScmapEditor.Current.SetTextures(ToLayer); ReloadStratums(); SelectStratum(ToLayer); }