You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
571 B
27 lines
571 B
using UnityEngine; |
|
using UnityEditor; |
|
using System.Collections; |
|
|
|
namespace Fungus |
|
{ |
|
|
|
public class CameraMenuItems |
|
{ |
|
[MenuItem("GameObject/Fungus/Camera/View")] |
|
static void CreateBackground() |
|
{ |
|
InstantiatePrefab("View"); |
|
} |
|
|
|
static void InstantiatePrefab(string prefabName) |
|
{ |
|
GameObject prefab = Resources.LoadAssetAtPath("Assets/Fungus/Camera/Prefabs/" + prefabName + ".prefab", typeof(GameObject)) as GameObject; |
|
if (prefab != null) |
|
{ |
|
GameObject go = GameObject.Instantiate(prefab) as GameObject; |
|
go.name = prefabName; |
|
} |
|
} |
|
} |
|
|
|
} |