Browse Source

Added Example project and SetSayDialog & SetChooseDialog

master
chrisgregan 10 years ago
parent
commit
692acac12f
  1. 5
      Assets/Example.meta
  2. 5
      Assets/Example/Characters.meta
  3. BIN
      Assets/Example/Characters/Roamer.prefab
  4. 4
      Assets/Example/Characters/Roamer.prefab.meta
  5. BIN
      Assets/Example/Characters/Skipper.prefab
  6. 4
      Assets/Example/Characters/Skipper.prefab.meta
  7. BIN
      Assets/Example/Characters/Urchin Girl.prefab
  8. 4
      Assets/Example/Characters/Urchin Girl.prefab.meta
  9. 5
      Assets/Example/Dialogs.meta
  10. BIN
      Assets/Example/Dialogs/ChooseDialog.prefab
  11. 4
      Assets/Example/Dialogs/ChooseDialog.prefab.meta
  12. BIN
      Assets/Example/Dialogs/SayDialog.prefab
  13. 4
      Assets/Example/Dialogs/SayDialog.prefab.meta
  14. 5
      Assets/Example/Scenes.meta
  15. BIN
      Assets/Example/Scenes/Example.unity
  16. 4
      Assets/Example/Scenes/Example.unity.meta
  17. 5
      Assets/Example/Sprites.meta
  18. BIN
      Assets/Example/Sprites/Roamer.psd
  19. 48
      Assets/Example/Sprites/Roamer.psd.meta
  20. BIN
      Assets/Example/Sprites/RoamerProfile.psd
  21. 48
      Assets/Example/Sprites/RoamerProfile.psd.meta
  22. BIN
      Assets/Example/Sprites/Skipper.psd
  23. 48
      Assets/Example/Sprites/Skipper.psd.meta
  24. BIN
      Assets/Example/Sprites/SkipperProfile.psd
  25. 48
      Assets/Example/Sprites/SkipperProfile.psd.meta
  26. BIN
      Assets/Example/Sprites/UrchinGirl.psd
  27. 48
      Assets/Example/Sprites/UrchinGirl.psd.meta
  28. BIN
      Assets/Example/Sprites/UrchinGirlProfile.psd
  29. 48
      Assets/Example/Sprites/UrchinGirlProfile.psd.meta
  30. 17
      Assets/Fungus/Dialog/Commands/Choose.cs
  31. 18
      Assets/Fungus/Dialog/Commands/Say.cs
  32. 38
      Assets/Fungus/Dialog/Commands/SetChooseDialog.cs
  33. 8
      Assets/Fungus/Dialog/Commands/SetChooseDialog.cs.meta
  34. 38
      Assets/Fungus/Dialog/Commands/SetSayDialog.cs
  35. 8
      Assets/Fungus/Dialog/Commands/SetSayDialog.cs.meta
  36. 6
      Assets/Fungus/Dialog/Editor/ChooseEditor.cs
  37. 6
      Assets/Fungus/Dialog/Editor/SayEditor.cs
  38. 32
      Assets/Fungus/Dialog/Editor/SetChooseDialogEditor.cs
  39. 8
      Assets/Fungus/Dialog/Editor/SetChooseDialogEditor.cs.meta
  40. 32
      Assets/Fungus/Dialog/Editor/SetSayDialogEditor.cs
  41. 8
      Assets/Fungus/Dialog/Editor/SetSayDialogEditor.cs.meta

5
Assets/Example.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 4b09c77dc01c54b5084100479119d16d
folderAsset: yes
DefaultImporter:
userData:

5
Assets/Example/Characters.meta

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

BIN
Assets/Example/Characters/Roamer.prefab

Binary file not shown.

4
Assets/Example/Characters/Roamer.prefab.meta

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 68e611507bef949a8be6528922662936
NativeFormatImporter:
userData:

BIN
Assets/Example/Characters/Skipper.prefab

Binary file not shown.

4
Assets/Example/Characters/Skipper.prefab.meta

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: a98bc2f48ea5f4460817c1e508f936ca
NativeFormatImporter:
userData:

BIN
Assets/Example/Characters/Urchin Girl.prefab

Binary file not shown.

4
Assets/Example/Characters/Urchin Girl.prefab.meta

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 3191a22b2027f496799374d6613d74a0
NativeFormatImporter:
userData:

5
Assets/Example/Dialogs.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 3c106739e85e1461e8eb294ef107958c
folderAsset: yes
DefaultImporter:
userData:

BIN
Assets/Example/Dialogs/ChooseDialog.prefab

Binary file not shown.

4
Assets/Example/Dialogs/ChooseDialog.prefab.meta

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 6b7fc59bc2eb0416e91931c4248923ae
NativeFormatImporter:
userData:

BIN
Assets/Example/Dialogs/SayDialog.prefab

Binary file not shown.

4
Assets/Example/Dialogs/SayDialog.prefab.meta

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 00974f07e5b9248d48d344335b83f4bd
NativeFormatImporter:
userData:

5
Assets/Example/Scenes.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 01aa5d8be39a64aefa40bbe2bb40a9d1
folderAsset: yes
DefaultImporter:
userData:

BIN
Assets/Example/Scenes/Example.unity

Binary file not shown.

4
Assets/Example/Scenes/Example.unity.meta

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 7456307ca6764419c87a92bb5351630d
DefaultImporter:
userData:

5
Assets/Example/Sprites.meta

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

BIN
Assets/Example/Sprites/Roamer.psd

Binary file not shown.

48
Assets/Example/Sprites/Roamer.psd.meta

@ -0,0 +1,48 @@
fileFormatVersion: 2
guid: 6b100daff28d04f69a49015f83966425
TextureImporter:
fileIDToRecycleName:
21300000: Roamer
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: 1024
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:

BIN
Assets/Example/Sprites/RoamerProfile.psd

Binary file not shown.

48
Assets/Example/Sprites/RoamerProfile.psd.meta

@ -0,0 +1,48 @@
fileFormatVersion: 2
guid: f7484a661774243b193bebc6e3ae5120
TextureImporter:
fileIDToRecycleName:
21300000: RoamerProfile
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: 1024
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:

BIN
Assets/Example/Sprites/Skipper.psd

Binary file not shown.

48
Assets/Example/Sprites/Skipper.psd.meta

@ -0,0 +1,48 @@
fileFormatVersion: 2
guid: ed14cc18e1e37449eb670f2613314102
TextureImporter:
fileIDToRecycleName:
21300000: Skipper
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: 1024
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:

BIN
Assets/Example/Sprites/SkipperProfile.psd

Binary file not shown.

48
Assets/Example/Sprites/SkipperProfile.psd.meta

@ -0,0 +1,48 @@
fileFormatVersion: 2
guid: 3c64e30cbefbe4e768ef68d85c85061e
TextureImporter:
fileIDToRecycleName:
21300000: SkipperProfile
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: 1024
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:

BIN
Assets/Example/Sprites/UrchinGirl.psd

Binary file not shown.

48
Assets/Example/Sprites/UrchinGirl.psd.meta

@ -0,0 +1,48 @@
fileFormatVersion: 2
guid: c784f0adc2ce544be915fc26a2b4b510
TextureImporter:
fileIDToRecycleName:
21300000: UrchinGirl
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: 1024
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:

BIN
Assets/Example/Sprites/UrchinGirlProfile.psd

Binary file not shown.

48
Assets/Example/Sprites/UrchinGirlProfile.psd.meta

@ -0,0 +1,48 @@
fileFormatVersion: 2
guid: 05ccd53483a554ca9b31f685fa76154a
TextureImporter:
fileIDToRecycleName:
21300000: UrchinGirlProfile
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: 1024
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:

17
Assets/Fungus/Dialog/Commands/Choose.cs

@ -10,9 +10,6 @@ namespace Fungus.Script
"Presents a list of options for the player to choose from, with an optional timeout. Add options using preceding AddOption commands.")] "Presents a list of options for the player to choose from, with an optional timeout. Add options using preceding AddOption commands.")]
public class Choose : FungusCommand public class Choose : FungusCommand
{ {
public ChooseDialog dialog;
static public ChooseDialog activeDialog;
public class Option public class Option
{ {
public string optionText; public string optionText;
@ -30,23 +27,13 @@ namespace Fungus.Script
public override void OnEnter() public override void OnEnter()
{ {
// Remember active dialog between Choose calls ChooseDialog dialog = SetChooseDialog.activeDialog;
showBasicGUI = false;
if (dialog == null) if (dialog == null)
{
if (Choose.activeDialog == null)
{ {
showBasicGUI = true; showBasicGUI = true;
return; return;
} }
else
{
dialog = Choose.activeDialog;
}
}
else
{
activeDialog = dialog;
}
if (options.Count == 0) if (options.Count == 0)
{ {

18
Assets/Fungus/Dialog/Commands/Say.cs

@ -10,10 +10,6 @@ namespace Fungus.Script
"Writes a line of story text to the dialog. A list of options can be specified for the player to choose from. Use a non-zero timeout to give the player a limited time to choose.")] "Writes a line of story text to the dialog. A list of options can be specified for the player to choose from. Use a non-zero timeout to give the player a limited time to choose.")]
public class Say : FungusCommand public class Say : FungusCommand
{ {
public SayDialog dialog;
static public SayDialog activeDialog;
public Character character; public Character character;
public string storyText; public string storyText;
public AudioClip voiceOverClip; public AudioClip voiceOverClip;
@ -32,23 +28,13 @@ namespace Fungus.Script
executionCount++; executionCount++;
// Remember active dialog between Say calls SayDialog dialog = SetSayDialog.activeDialog;
showBasicGUI = false;
if (dialog == null) if (dialog == null)
{
if (activeDialog == null)
{ {
showBasicGUI = true; showBasicGUI = true;
return; return;
} }
else
{
dialog = activeDialog;
}
}
else
{
activeDialog = dialog;
}
dialog.SetCharacter(character); dialog.SetCharacter(character);

38
Assets/Fungus/Dialog/Commands/SetChooseDialog.cs

@ -0,0 +1,38 @@
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Fungus.Script
{
[CommandInfo("Dialog",
"Set Choose Dialog",
"Sets the active dialog to use for displaying story text with the Choose command.")]
public class SetChooseDialog : FungusCommand
{
public ChooseDialog dialog;
static public ChooseDialog activeDialog;
public override void OnEnter()
{
activeDialog = dialog;
Continue();
}
public override string GetSummary()
{
if (dialog == null)
{
return "Error: No dialog selected";
}
return dialog.name;
}
public override Color GetButtonColor()
{
return new Color32(184, 210, 235, 255);
}
}
}

8
Assets/Fungus/Dialog/Commands/SetChooseDialog.cs.meta

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

38
Assets/Fungus/Dialog/Commands/SetSayDialog.cs

@ -0,0 +1,38 @@
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Fungus.Script
{
[CommandInfo("Dialog",
"Set Say Dialog",
"Sets the active dialog to use for displaying story text with the Say command.")]
public class SetSayDialog : FungusCommand
{
public SayDialog dialog;
static public SayDialog activeDialog;
public override void OnEnter()
{
activeDialog = dialog;
Continue();
}
public override string GetSummary()
{
if (dialog == null)
{
return "Error: No dialog selected";
}
return dialog.name;
}
public override Color GetButtonColor()
{
return new Color32(184, 210, 235, 255);
}
}
}

8
Assets/Fungus/Dialog/Commands/SetSayDialog.cs.meta

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

6
Assets/Fungus/Dialog/Editor/ChooseEditor.cs

@ -42,11 +42,6 @@ namespace Fungus.Script
t.character, t.character,
Character.activeCharacters); Character.activeCharacters);
ChooseDialog dialog = FungusCommandEditor.ObjectField<ChooseDialog>(new GUIContent("Choose Dialog", "Dialog to use when displaying choices"),
new GUIContent("<Default>"),
t.dialog,
ChooseDialog.activeDialogs);
AudioClip voiceOverClip = EditorGUILayout.ObjectField(new GUIContent("Voice Over Clip", "Voice over audio to play when the choose text is displayed"), AudioClip voiceOverClip = EditorGUILayout.ObjectField(new GUIContent("Voice Over Clip", "Voice over audio to play when the choose text is displayed"),
t.voiceOverClip, t.voiceOverClip,
typeof(AudioClip), typeof(AudioClip),
@ -59,7 +54,6 @@ namespace Fungus.Script
Undo.RecordObject(t, "Set Choose"); Undo.RecordObject(t, "Set Choose");
t.chooseText = chooseText; t.chooseText = chooseText;
t.character = character; t.character = character;
t.dialog = dialog;
t.voiceOverClip = voiceOverClip; t.voiceOverClip = voiceOverClip;
t.timeoutDuration = timeoutDuration; t.timeoutDuration = timeoutDuration;
} }

6
Assets/Fungus/Dialog/Editor/SayEditor.cs

@ -81,11 +81,6 @@ namespace Fungus.Script
t.character, t.character,
Character.activeCharacters); Character.activeCharacters);
SayDialog dialog = FungusCommandEditor.ObjectField<SayDialog>(new GUIContent("Say Dialog", "Dialog to use when displaying Say command story text"),
new GUIContent("<Default>"),
t.dialog,
SayDialog.activeDialogs);
AudioClip voiceOverClip = EditorGUILayout.ObjectField(new GUIContent("Voice Over Clip", "Voice over audio to play when the say text is displayed"), AudioClip voiceOverClip = EditorGUILayout.ObjectField(new GUIContent("Voice Over Clip", "Voice over audio to play when the say text is displayed"),
t.voiceOverClip, t.voiceOverClip,
typeof(AudioClip), typeof(AudioClip),
@ -98,7 +93,6 @@ namespace Fungus.Script
Undo.RecordObject(t, "Set Say"); Undo.RecordObject(t, "Set Say");
t.storyText = text; t.storyText = text;
t.character = character; t.character = character;
t.dialog = dialog;
t.voiceOverClip = voiceOverClip; t.voiceOverClip = voiceOverClip;
t.showOnce = showOnce; t.showOnce = showOnce;
} }

32
Assets/Fungus/Dialog/Editor/SetChooseDialogEditor.cs

@ -0,0 +1,32 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Rotorz.ReorderableList;
namespace Fungus.Script
{
[CustomEditor (typeof(SetChooseDialog))]
public class SetChooseDialogEditor : FungusCommandEditor
{
public override void DrawCommandGUI()
{
SetChooseDialog t = target as SetChooseDialog;
EditorGUI.BeginChangeCheck();
ChooseDialog dialog = FungusCommandEditor.ObjectField<ChooseDialog>(new GUIContent("Choose Dialog", "Dialog to use when displaying options with the Choose command."),
new GUIContent("<None>"),
t.dialog,
ChooseDialog.activeDialogs);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(t, "Set Choose Dialog");
t.dialog = dialog;
}
}
}
}

8
Assets/Fungus/Dialog/Editor/SetChooseDialogEditor.cs.meta

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

32
Assets/Fungus/Dialog/Editor/SetSayDialogEditor.cs

@ -0,0 +1,32 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Rotorz.ReorderableList;
namespace Fungus.Script
{
[CustomEditor (typeof(SetSayDialog))]
public class SetSayDialogEditor : FungusCommandEditor
{
public override void DrawCommandGUI()
{
SetSayDialog t = target as SetSayDialog;
EditorGUI.BeginChangeCheck();
SayDialog dialog = FungusCommandEditor.ObjectField<SayDialog>(new GUIContent("Say Dialog", "Dialog to use when displaying Say command story text"),
new GUIContent("<None>"),
t.dialog,
SayDialog.activeDialogs);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(t, "Set Say Dialog");
t.dialog = dialog;
}
}
}
}

8
Assets/Fungus/Dialog/Editor/SetSayDialogEditor.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 571831413078e48d0bb29a408ee1ba71
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
Loading…
Cancel
Save