|
|
@ -24,6 +24,20 @@ namespace Fungus |
|
|
|
GetWindow(typeof(FungusScriptWindow), false, "Fungus Script"); |
|
|
|
GetWindow(typeof(FungusScriptWindow), false, "Fungus Script"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MenuItem("GameObject/Fungus/Fungus Script")] |
|
|
|
|
|
|
|
static void CreateFungusScript() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
GameObject newFungusScriptGO = new GameObject(); |
|
|
|
|
|
|
|
newFungusScriptGO.name = "FungusScript"; |
|
|
|
|
|
|
|
FungusScript fungusScript = newFungusScriptGO.AddComponent<FungusScript>(); |
|
|
|
|
|
|
|
GameObject newSequenceGO = new GameObject(); |
|
|
|
|
|
|
|
newSequenceGO.transform.parent = newFungusScriptGO.transform; |
|
|
|
|
|
|
|
newSequenceGO.name = "Start"; |
|
|
|
|
|
|
|
newSequenceGO.hideFlags = HideFlags.HideInHierarchy; |
|
|
|
|
|
|
|
Sequence sequence = newSequenceGO.AddComponent<Sequence>(); |
|
|
|
|
|
|
|
fungusScript.startSequence = sequence; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Implementing this method causes the padlock image to display on the window |
|
|
|
// Implementing this method causes the padlock image to display on the window |
|
|
|
// https://leahayes.wordpress.com/2013/04/30/adding-the-little-padlock-button-to-your-editorwindow/#more-455 |
|
|
|
// https://leahayes.wordpress.com/2013/04/30/adding-the-little-padlock-button-to-your-editorwindow/#more-455 |
|
|
|
void ShowButton(Rect position) { |
|
|
|
void ShowButton(Rect position) { |
|
|
@ -138,7 +152,7 @@ namespace Fungus |
|
|
|
{ |
|
|
|
{ |
|
|
|
Sequence sequence = sequences[i]; |
|
|
|
Sequence sequence = sequences[i]; |
|
|
|
|
|
|
|
|
|
|
|
float titleWidth = windowStyle.CalcSize(new GUIContent(sequence.sequenceName)).x; |
|
|
|
float titleWidth = windowStyle.CalcSize(new GUIContent(sequence.name)).x; |
|
|
|
float windowWidth = Mathf.Max (titleWidth + 10, 100); |
|
|
|
float windowWidth = Mathf.Max (titleWidth + 10, 100); |
|
|
|
|
|
|
|
|
|
|
|
if (fungusScript.selectedSequence == sequence || |
|
|
|
if (fungusScript.selectedSequence == sequence || |
|
|
@ -310,7 +324,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
GUILayout.BeginVertical(); |
|
|
|
GUILayout.BeginVertical(); |
|
|
|
GUILayout.FlexibleSpace(); |
|
|
|
GUILayout.FlexibleSpace(); |
|
|
|
GUILayout.Label(sequence.sequenceName, labelStyle); |
|
|
|
GUILayout.Label(sequence.name, labelStyle); |
|
|
|
GUILayout.FlexibleSpace(); |
|
|
|
GUILayout.FlexibleSpace(); |
|
|
|
GUILayout.EndVertical(); |
|
|
|
GUILayout.EndVertical(); |
|
|
|
|
|
|
|
|
|
|
|