This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transferring new SceneHelper script to core (#457)
- Loading branch information
1 parent
2bf2322
commit ad62f39
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.