From 1de742cbb4770defc1913a895863e38140369985 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Fri, 22 May 2015 10:50:42 +0100 Subject: [PATCH] Spawn narrative prefabs at 0,0,0 by default #106 --- .../Flowchart/Editor/FlowchartMenuItems.cs | 3 ++- .../Narrative/Editor/NarrativeMenuItems.cs | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Assets/Fungus/Flowchart/Editor/FlowchartMenuItems.cs b/Assets/Fungus/Flowchart/Editor/FlowchartMenuItems.cs index cfb84fd6..01b4ca9d 100644 --- a/Assets/Fungus/Flowchart/Editor/FlowchartMenuItems.cs +++ b/Assets/Fungus/Flowchart/Editor/FlowchartMenuItems.cs @@ -11,7 +11,8 @@ namespace Fungus [MenuItem("Tools/Fungus/Create/Flowchart", false, 0)] static void CreateFlowchart() { - SpawnPrefab("Flowchart"); + GameObject go = SpawnPrefab("Flowchart"); + go.transform.position = Vector3.zero; } public static GameObject SpawnPrefab(string prefabName) diff --git a/Assets/Fungus/Narrative/Editor/NarrativeMenuItems.cs b/Assets/Fungus/Narrative/Editor/NarrativeMenuItems.cs index ee4450ad..23a23d56 100644 --- a/Assets/Fungus/Narrative/Editor/NarrativeMenuItems.cs +++ b/Assets/Fungus/Narrative/Editor/NarrativeMenuItems.cs @@ -12,37 +12,43 @@ namespace Fungus [MenuItem("Tools/Fungus/Create/Character", false, 50)] static void CreateCharacter() { - FlowchartMenuItems.SpawnPrefab("Character"); + GameObject go = FlowchartMenuItems.SpawnPrefab("Character"); + go.transform.position = Vector3.zero; } [MenuItem("Tools/Fungus/Create/Say Dialog", false, 51)] static void CreateSayDialog() { - FlowchartMenuItems.SpawnPrefab("SayDialog"); + GameObject go = FlowchartMenuItems.SpawnPrefab("SayDialog"); + go.transform.position = Vector3.zero; } [MenuItem("Tools/Fungus/Create/Menu Dialog", false, 52)] static void CreateMenuDialog() { - FlowchartMenuItems.SpawnPrefab("MenuDialog"); + GameObject go = FlowchartMenuItems.SpawnPrefab("MenuDialog"); + go.transform.position = Vector3.zero; } [MenuItem("Tools/Fungus/Create/Tag", false, 53)] static void CreateTag() { - FlowchartMenuItems.SpawnPrefab("Tag"); + GameObject go = FlowchartMenuItems.SpawnPrefab("Tag"); + go.transform.position = Vector3.zero; } [MenuItem("Tools/Fungus/Create/Audio Tag", false, 54)] static void CreateAudioTag() { - FlowchartMenuItems.SpawnPrefab("AudioTag"); + GameObject go = FlowchartMenuItems.SpawnPrefab("AudioTag"); + go.transform.position = Vector3.zero; } [MenuItem("Tools/Fungus/Create/Stage", false, 55)] static void CreateStage() { - FlowchartMenuItems.SpawnPrefab("Stage"); + GameObject go = FlowchartMenuItems.SpawnPrefab("Stage"); + go.transform.position = Vector3.zero; } [MenuItem("Tools/Fungus/Create/Stage Position", false, 56)] @@ -54,7 +60,8 @@ namespace Fungus [MenuItem("Tools/Fungus/Create/Localization", false, 57)] static void CreateLocalization() { - FlowchartMenuItems.SpawnPrefab("Localization"); + GameObject go = FlowchartMenuItems.SpawnPrefab("Localization"); + go.transform.position = Vector3.zero; } }