public static void CreateGameObject(int x, int y) { var gameObject = PreviewObject.CreateGameObject(); gameObject.transform.position = new Vector3(x, y, 0); gameObject.transform.MoveToSection(Matrix.Matrix.At(x, y).Section, MapEditorMap.CurrentSubSectionName); Undo.RegisterCreatedObjectUndo(gameObject, "Create " + gameObject.name); }
public static void CreateGameObject(Vector3 position) { var gameObject = PreviewObject.CreateGameObject(); gameObject.transform.position = position; gameObject.transform.parent = MapEditorMap.CurrentSubSection; Undo.RegisterCreatedObjectUndo(gameObject, "Create " + gameObject.name); }