An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
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.
|
|
|
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 = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
|
|
|
|
go.name = prefabName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|