Exemplo n.º 1
0
    //Called by the BiomeColorGradientEditorWindow to keep a stack of undoStates
    public static BiomeColorGradient Clone(BiomeColorGradient gradient)
    {
        BiomeColorGradient clone = new BiomeColorGradient();

        clone.mimic(gradient);
        return(clone);
    }
Exemplo n.º 2
0
    void undo()
    {
        if (undoStack.Count == 0)
        {
            return;
        }
        UndoState prevGradientState = undoStack.Pop();

        //Simply reassigning biomeGradient to prevGradientState.gradient seems to break the link between the gradient and the biome. I think it may have to do with serialization
        biomeGradient.mimic(prevGradientState.gradient);

        selectedKeyIndex = prevGradientState.selectedIndex;
        redrawEditorNoiseMap();
        Repaint();
    }