Browse Source

Added Camera & Sprite menu items

master
chrisgregan 10 years ago
parent
commit
6e18bbd619
  1. 27
      Assets/Fungus/Camera/Editor/CameraMenuItems.cs
  2. 8
      Assets/Fungus/Camera/Editor/CameraMenuItems.cs.meta
  3. 5
      Assets/Fungus/Sprite/Editor.meta
  4. 29
      Assets/Fungus/Sprite/Editor/SpriteMenuItems.cs
  5. 8
      Assets/Fungus/Sprite/Editor/SpriteMenuItems.cs.meta
  6. BIN
      Assets/Fungus/Sprite/Prefabs/Background.prefab
  7. 4
      Assets/Fungus/Sprite/Prefabs/Background.prefab.meta

27
Assets/Fungus/Camera/Editor/CameraMenuItems.cs

@ -0,0 +1,27 @@
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;
}
}
}
}

8
Assets/Fungus/Camera/Editor/CameraMenuItems.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 51343e36134df4735b2d56529127c93d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

5
Assets/Fungus/Sprite/Editor.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 6de313ae80cb3443ab384d5491b0839c
folderAsset: yes
DefaultImporter:
userData:

29
Assets/Fungus/Sprite/Editor/SpriteMenuItems.cs

@ -0,0 +1,29 @@
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace Fungus
{
public class SpriteMenuItems
{
[MenuItem("GameObject/Fungus/Sprite/ParallaxSprite")]
static void CreateBackground()
{
InstantiatePrefab("ParallaxSprite");
}
static void InstantiatePrefab(string prefabName)
{
GameObject prefab = Resources.LoadAssetAtPath("Assets/Fungus/Sprite/Prefabs/" + prefabName + ".prefab", typeof(GameObject)) as GameObject;
if (prefab != null)
{
GameObject go = GameObject.Instantiate(prefab) as GameObject;
go.name = prefabName;
}
}
}
}

8
Assets/Fungus/Sprite/Editor/SpriteMenuItems.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 06d0a1fb0d8114b0c953983b0424cc89
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

BIN
Assets/Fungus/Sprite/Prefabs/Background.prefab

Binary file not shown.

4
Assets/Fungus/Sprite/Prefabs/Background.prefab.meta

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 7dd153b86fca74c329ccf129422fdbe2
NativeFormatImporter:
userData:
Loading…
Cancel
Save