diff --git a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs index d20969fc..36d53ef7 100644 --- a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs @@ -86,6 +86,9 @@ namespace Fungus.Script GUIContent startSequenceLabel = new GUIContent("Start Sequence", "Sequence to be executed when controller starts."); t.startSequence = SequenceEditor.SequenceField(startSequenceLabel, t, t.startSequence); + GUIContent startAutomaticallyLabel = new GUIContent("Start Automatically", "Start this Fungus Script when the scene starts."); + t.startAutomatically = EditorGUILayout.Toggle(startAutomaticallyLabel, t.startAutomatically); + if (t.startSequence == null) { GUIStyle style = new GUIStyle(GUI.skin.label); diff --git a/Assets/Fungus/Editor/FungusScript/SayEditor.cs b/Assets/Fungus/Editor/FungusScript/SayEditor.cs index 542dd385..23fcfd27 100644 --- a/Assets/Fungus/Editor/FungusScript/SayEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/SayEditor.cs @@ -14,12 +14,18 @@ namespace Fungus.Script { Say t = target as Say; + EditorGUI.BeginChangeCheck(); + + string character = EditorGUILayout.TextField(new GUIContent("Character", "Character to display in dialog"), t.character); + EditorGUILayout.PrefixLabel(new GUIContent("Say Text", "Text to display in dialog")); EditorStyles.textField.wordWrap = true; string text = EditorGUILayout.TextArea(t.text, GUILayout.MinHeight(50)); - if (text != t.text) + + if (EditorGUI.EndChangeCheck()) { - Undo.RecordObject(t, "Set Text"); + Undo.RecordObject(t, "Set Say"); + t.character = character; t.text = text; } } diff --git a/Assets/Fungus/Prefabs/Dialog.prefab b/Assets/Fungus/Prefabs/Dialog.prefab index 35f55282..2172e066 100644 Binary files a/Assets/Fungus/Prefabs/Dialog.prefab and b/Assets/Fungus/Prefabs/Dialog.prefab differ diff --git a/Assets/Fungus/VisualScripting/FungusScript.cs b/Assets/Fungus/VisualScripting/FungusScript.cs index c006c30e..2b59ad52 100644 --- a/Assets/Fungus/VisualScripting/FungusScript.cs +++ b/Assets/Fungus/VisualScripting/FungusScript.cs @@ -20,6 +20,16 @@ namespace Fungus.Script public List variables = new List(); + public bool startAutomatically = false; + + void Start() + { + if (startAutomatically) + { + Execute(); + } + } + public void Execute() { if (startSequence == null) diff --git a/Assets/Fungus/VisualScripting/Say.cs b/Assets/Fungus/VisualScripting/Say.cs index 88b5e21c..f4851d42 100644 --- a/Assets/Fungus/VisualScripting/Say.cs +++ b/Assets/Fungus/VisualScripting/Say.cs @@ -7,6 +7,7 @@ namespace Fungus.Script { public class Say : FungusCommand { + public string character; public string text; public override void OnEnter() @@ -18,6 +19,11 @@ namespace Fungus.Script return; } + if (character.Length > 0) + { + dialog.SetCharacter(character); + } + dialog.Say (text, delegate { Continue(); }); diff --git a/Assets/Fungus/VisualScripting/Sequence.cs b/Assets/Fungus/VisualScripting/Sequence.cs index 61eeaf78..1a5694d6 100644 --- a/Assets/Fungus/VisualScripting/Sequence.cs +++ b/Assets/Fungus/VisualScripting/Sequence.cs @@ -34,6 +34,7 @@ namespace Fungus.Script while (parent != null) { sc = parent.gameObject.GetComponent(); + if (sc != null) { break; @@ -103,14 +104,14 @@ namespace Fungus.Script } else { - if (fungusScript.stepTime == 0f) + if (GetFungusScript().stepTime == 0f) { activeCommand = nextCommand; nextCommand.Execute(); } else { - StartCoroutine(ExecuteAfterDelay(nextCommand, fungusScript.stepTime)); + StartCoroutine(ExecuteAfterDelay(nextCommand, GetFungusScript().stepTime)); } } diff --git a/Assets/Shuttle.meta b/Assets/Shuttle.meta new file mode 100644 index 00000000..c27a51b6 --- /dev/null +++ b/Assets/Shuttle.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 004648c23027842d89a0ebbe7a187e16 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Assets/Shuttle/BlastOff.psd b/Assets/Shuttle/BlastOff.psd new file mode 100644 index 00000000..9fa00b24 Binary files /dev/null and b/Assets/Shuttle/BlastOff.psd differ diff --git a/Assets/Shuttle/BlastOff.psd.meta b/Assets/Shuttle/BlastOff.psd.meta new file mode 100644 index 00000000..6c94bbc4 --- /dev/null +++ b/Assets/Shuttle/BlastOff.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: a05caf3c2adde4354ab97475891baa4e +TextureImporter: + fileIDToRecycleName: + 21300000: BlastOff + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity new file mode 100644 index 00000000..110c4833 Binary files /dev/null and b/Assets/Shuttle/ShuttleGame.unity differ diff --git a/Assets/Shuttle/ShuttleGame.unity.meta b/Assets/Shuttle/ShuttleGame.unity.meta new file mode 100644 index 00000000..4411bd2b --- /dev/null +++ b/Assets/Shuttle/ShuttleGame.unity.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: b146c63736a624985b231df6d811556c +DefaultImporter: + userData: diff --git a/Assets/Shuttle/astronaut.psd b/Assets/Shuttle/astronaut.psd new file mode 100644 index 00000000..b863e9cb Binary files /dev/null and b/Assets/Shuttle/astronaut.psd differ diff --git a/Assets/Shuttle/astronaut.psd.meta b/Assets/Shuttle/astronaut.psd.meta new file mode 100644 index 00000000..72a2778b --- /dev/null +++ b/Assets/Shuttle/astronaut.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: ac4b38619d5db44de80ed2cfda81e347 +TextureImporter: + fileIDToRecycleName: + 21300000: astronaut + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/Assets/Shuttle/evil_lego.psd b/Assets/Shuttle/evil_lego.psd new file mode 100644 index 00000000..c25ed3d9 Binary files /dev/null and b/Assets/Shuttle/evil_lego.psd differ diff --git a/Assets/Shuttle/evil_lego.psd.meta b/Assets/Shuttle/evil_lego.psd.meta new file mode 100644 index 00000000..cdf25c6f --- /dev/null +++ b/Assets/Shuttle/evil_lego.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: 93a468c44b689462f885cf72b990adcf +TextureImporter: + fileIDToRecycleName: + 21300000: evil_lego + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/Assets/Shuttle/good_astronaut.psd b/Assets/Shuttle/good_astronaut.psd new file mode 100644 index 00000000..cc3219c7 Binary files /dev/null and b/Assets/Shuttle/good_astronaut.psd differ diff --git a/Assets/Shuttle/good_astronaut.psd.meta b/Assets/Shuttle/good_astronaut.psd.meta new file mode 100644 index 00000000..f8e0bef4 --- /dev/null +++ b/Assets/Shuttle/good_astronaut.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: 76e77ed4a223948648e4676fd5507897 +TextureImporter: + fileIDToRecycleName: + 21300000: good_astronaut + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/Assets/Shuttle/shuttle.psd b/Assets/Shuttle/shuttle.psd new file mode 100644 index 00000000..2c817199 Binary files /dev/null and b/Assets/Shuttle/shuttle.psd differ diff --git a/Assets/Shuttle/shuttle.psd.meta b/Assets/Shuttle/shuttle.psd.meta new file mode 100644 index 00000000..ca9fb586 --- /dev/null +++ b/Assets/Shuttle/shuttle.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: 85395597a78fa41ec9f72ae513326eaa +TextureImporter: + fileIDToRecycleName: + 21300000: shuttle + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: