/// <summary> /// Add another coordinate slot for the specified character /// </summary> /// <param name="chaControl">The character being modified</param> public static void AddCoordinateSlot(ChaControl chaControl) { //Initialize a new bigger array, copy the contents of the old var newCoordinate = new ChaFileCoordinate[chaControl.chaFile.coordinate.Length + 1]; for (int i = 0; i < chaControl.chaFile.coordinate.Length; i++) { newCoordinate[i] = chaControl.chaFile.coordinate[i]; } newCoordinate[newCoordinate.Length - 1] = new ChaFileCoordinate(); chaControl.chaFile.coordinate = newCoordinate; MakerUI.UpdateMakerUI(); }
/// <summary> /// Remove the last added coordinate slot for the specified character /// </summary> /// <param name="chaControl">The character being modified</param> public static void RemoveCoordinateSlot(ChaControl chaControl) { //Initialize a new smaller array, copy the contents of the old if (chaControl.chaFile.coordinate.Length <= OriginalCoordinateLength) { return; } var newCoordinate = new ChaFileCoordinate[chaControl.chaFile.coordinate.Length - 1]; for (int i = 0; i < newCoordinate.Length; i++) { newCoordinate[i] = chaControl.chaFile.coordinate[i]; } chaControl.chaFile.coordinate = newCoordinate; MakerUI.UpdateMakerUI(); }