In the PictureController script, add the following code to the Execute() function:
File: PictureController.cs case PictureCommand.ADD: AddPicture(); break; case PictureCommand.DELETE: DeletePicture(); break;
Write the corresponding implementations of the commands:
private void AddPicture() { DoneEdit(); GameController.instance.CreateNewPicture(); } private void DeletePicture() { Destroy(gameObject); }
AddPicture will close the current picture editing and create a new picture via GameController. DeletePicture will delete the current game object.
Let's try it out. Save your work and press Play. Use the toolbar's Add button to create a new picture, move it into place, and create another. Use the ...