Skip to content

Commit

Permalink
Changed things to make it a bit easier to manage via git
Browse files Browse the repository at this point in the history
  • Loading branch information
weldonla committed May 22, 2019
1 parent 1980881 commit 5fdde71
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 8 deletions.
8 changes: 8 additions & 0 deletions ARjs_Unity.meta

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

26 changes: 20 additions & 6 deletions ARjs_Unity/Editor/ARGameObjectCreator.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
using UnityEngine;
using UnityEditor;

using System.IO;

public class ARGameObjectCreator : MonoBehaviour
{
static string path = "Assets/ARjs_Unity/Prefabs/";
static string path2 = "Assets/ARjs_Unity/ARjs_Unity/Prefabs/";

[MenuItem("GameObject/AR.js/ImageTarget", false, 9)]
static void PlaceImageTargetPrefabInScene()
{
GameObject imageTarget = AssetDatabase.LoadAssetAtPath("Assets/ARjs_Unity/Prefabs/ImageTarget.prefab", typeof(GameObject)) as GameObject;
string pathToUse = path;
if (Directory.Exists(path2)) pathToUse = path2;
GameObject imageTarget = AssetDatabase.LoadAssetAtPath(pathToUse + "ImageTarget.prefab", typeof(GameObject)) as GameObject;
GameObject sceneImageTarget = Instantiate(imageTarget, Vector3.zero, Quaternion.identity) as GameObject;
HelperFunctions.AddTag("ImageTarget");
sceneImageTarget.transform.tag = "ImageTarget";
Expand All @@ -16,7 +22,9 @@ static void PlaceImageTargetPrefabInScene()
[MenuItem("GameObject/AR.js/Plane", false, 10)]
static void PlacePlanePrefabInScene()
{
GameObject plane = AssetDatabase.LoadAssetAtPath("Assets/ARjs_Unity/Prefabs/Plane.prefab", typeof(GameObject)) as GameObject;
string pathToUse = path;
if (Directory.Exists(path2)) pathToUse = path2;
GameObject plane = AssetDatabase.LoadAssetAtPath(pathToUse + "Plane.prefab", typeof(GameObject)) as GameObject;
GameObject scenePlane;
if (Selection.activeGameObject != null)
{
Expand All @@ -35,7 +43,9 @@ static void PlacePlanePrefabInScene()
[MenuItem("GameObject/AR.js/Cube", false, 11)]
static void PlaceCubePrefabInScene()
{
GameObject cube = AssetDatabase.LoadAssetAtPath("Assets/ARjs_Unity/Prefabs/Cube.prefab", typeof(GameObject)) as GameObject;
string pathToUse = path;
if (Directory.Exists(path2)) pathToUse = path2;
GameObject cube = AssetDatabase.LoadAssetAtPath(pathToUse + "Cube.prefab", typeof(GameObject)) as GameObject;
GameObject sceneCube;
if (Selection.activeGameObject != null)
{
Expand All @@ -54,7 +64,9 @@ static void PlaceCubePrefabInScene()
[MenuItem("GameObject/AR.js/Sphere", false, 12)]
static void PlaceSpherePrefabInScene()
{
GameObject sphere = AssetDatabase.LoadAssetAtPath("Assets/ARjs_Unity/Prefabs/Sphere.prefab", typeof(GameObject)) as GameObject;
string pathToUse = path;
if (Directory.Exists(path2)) pathToUse = path2;
GameObject sphere = AssetDatabase.LoadAssetAtPath(pathToUse + "Sphere.prefab", typeof(GameObject)) as GameObject;
GameObject sceneSphere;
if (Selection.activeGameObject != null)
{
Expand All @@ -73,7 +85,9 @@ static void PlaceSpherePrefabInScene()
[MenuItem("GameObject/AR.js/Cylinder", false, 13)]
static void PlaceCylinderPrefabInScene()
{
GameObject cylinder = AssetDatabase.LoadAssetAtPath("Assets/ARjs_Unity/Prefabs/Cylinder.prefab", typeof(GameObject)) as GameObject;
string pathToUse = path;
if (Directory.Exists(path2)) pathToUse = path2;
GameObject cylinder = AssetDatabase.LoadAssetAtPath(pathToUse + "Cylinder.prefab", typeof(GameObject)) as GameObject;
GameObject sceneCylinder;
if (Selection.activeGameObject != null)
{
Expand Down
4 changes: 2 additions & 2 deletions ARjs_Unity/Icons/HIRO.jpg.meta

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

7 changes: 7 additions & 0 deletions LICENSE.meta

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

7 changes: 7 additions & 0 deletions README.md.meta

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

88 changes: 88 additions & 0 deletions adding_image_target_and_cube.gif.meta

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

88 changes: 88 additions & 0 deletions adding_textures.gif.meta

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

88 changes: 88 additions & 0 deletions making_button.gif.meta

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

0 comments on commit 5fdde71

Please sign in to comment.