Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Transferring new SceneHelper script to core (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDarksideJ authored Feb 18, 2020
1 parent 2bf2322 commit ad62f39
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Utilities/Editor/SceneHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEditor;
using UnityEngine;

namespace XRTK.Utilities.Editor
{
public class SceneHelpers
{
/// <summary>
/// Simple scene helper to create the beginnings of a scene, creating the scene root and a floor.
/// </summary>
[MenuItem("Mixed Reality Toolkit/Tools/Create Floor", false, 1)]
public static void CreateFloor()
{
//check if there is already a Scene Objects GO
var sceneRoot = GameObject.Find("Scene Objects");
if(!sceneRoot)
{
sceneRoot = new GameObject("Scene Objects");
var floor = GameObject.CreatePrimitive(PrimitiveType.Plane);
floor.name = "Ground";
floor.transform.SetParent(sceneRoot.transform);
}
}
}
}
11 changes: 11 additions & 0 deletions Utilities/Editor/SceneHelpers.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad62f39

Please sign in to comment.