static void CopySettings(MenuCommand command) { try { ITerrainDefaultGenerator tg = (ITerrainDefaultGenerator)command.context; StepsWrapper sw = new StepsWrapper(); sw.steps = tg.Steps; string text = JsonUtility.ToJson(sw); EditorGUIUtility.systemCopyBuffer = text; } catch { } }
static void PasteSteps(MenuCommand command) { try { string text = EditorGUIUtility.systemCopyBuffer; StepsWrapper sw = JsonUtility.FromJson <StepsWrapper> (text); StepData[] refSteps = sw.steps; StepData[] newSteps = new StepData[refSteps.Length]; for (int k = 0; k < refSteps.Length; k++) { newSteps [k] = refSteps [k]; } ITerrainDefaultGenerator thisTG = (ITerrainDefaultGenerator)command.context; thisTG.Steps = newSteps; EditorUtility.SetDirty(command.context); } catch { } }