Browse Source

Removed left / right setting for characters

Should use alternate dialogs if feature is required
master
chrisgregan 11 years ago
parent
commit
d1636c94c8
  1. 4
      Assets/Fungus/Dialog/Commands/Say.cs
  2. 4
      Assets/Fungus/Dialog/Editor/CharacterEditor.cs
  3. 1
      Assets/Fungus/Dialog/Scripts/Character.cs
  4. 44
      Assets/Fungus/Dialog/Scripts/Dialog.cs
  5. BIN
      Assets/Shuttle/ShuttleGame.unity

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

@ -51,10 +51,10 @@ namespace Fungus.Script
activeDialog = dialog; activeDialog = dialog;
} }
dialog.ShowDialog(true);
dialog.SetCharacter(character); dialog.SetCharacter(character);
dialog.ShowDialog(true);
if (voiceOverClip != null) if (voiceOverClip != null)
{ {
MusicController.GetInstance().PlaySound(voiceOverClip, 1f); MusicController.GetInstance().PlaySound(voiceOverClip, 1f);

4
Assets/Fungus/Dialog/Editor/CharacterEditor.cs

@ -42,9 +42,6 @@ namespace Fungus.Script
typeof(Sprite), typeof(Sprite),
true) as Sprite; true) as Sprite;
SayDialog.DialogSide dialogSide = (SayDialog.DialogSide)EditorGUILayout.EnumPopup(new GUIContent("Image Side", "Which side to display the image in the dialog"),
t.dialogSide);
EditorGUILayout.Separator(); EditorGUILayout.Separator();
if (characterImage != null && if (characterImage != null &&
@ -68,7 +65,6 @@ namespace Fungus.Script
t.characterName = characterName; t.characterName = characterName;
t.characterColor = characterColor; t.characterColor = characterColor;
t.characterImage = characterImage; t.characterImage = characterImage;
t.dialogSide = dialogSide;
} }
} }

1
Assets/Fungus/Dialog/Scripts/Character.cs

@ -10,7 +10,6 @@ namespace Fungus.Script
{ {
public string characterName; public string characterName;
public Sprite characterImage; public Sprite characterImage;
public SayDialog.DialogSide dialogSide;
public Color characterColor; public Color characterColor;
static public List<Character> activeCharacters = new List<Character>(); static public List<Character> activeCharacters = new List<Character>();

44
Assets/Fungus/Dialog/Scripts/Dialog.cs

@ -11,12 +11,6 @@ namespace Fungus.Script
public class Dialog : MonoBehaviour public class Dialog : MonoBehaviour
{ {
public enum DialogSide
{
Left,
Right
};
public float writingSpeed = 60; public float writingSpeed = 60;
public AudioClip writingSound; public AudioClip writingSound;
public bool loopWritingSound = true; public bool loopWritingSound = true;
@ -25,8 +19,7 @@ namespace Fungus.Script
public Canvas dialogCanvas; public Canvas dialogCanvas;
public Text nameText; public Text nameText;
public Text storyText; public Text storyText;
public Image leftImage; public Image characterImage;
public Image rightImage;
float currentSpeed; float currentSpeed;
float currentPunctuationPause; float currentPunctuationPause;
@ -71,47 +64,30 @@ namespace Fungus.Script
{ {
if (character == null) if (character == null)
{ {
if (leftImage != null) if (characterImage != null)
leftImage.enabled = false; characterImage.enabled = false;
if (rightImage != null)
rightImage.enabled = false;
if (nameText != null) if (nameText != null)
nameText.text = ""; nameText.text = "";
} }
else else
{ {
SetCharacterImage(character.characterImage, character.dialogSide); SetCharacterImage(character.characterImage);
SetCharacterName(character.name, character.characterColor); SetCharacterName(character.name, character.characterColor);
} }
} }
public void SetCharacterImage(Sprite image, DialogSide side) public void SetCharacterImage(Sprite image)
{ {
if (leftImage != null) if (characterImage != null)
{
if (image != null &&
side == DialogSide.Left)
{
leftImage.sprite = image;
leftImage.enabled = true;
}
else
{
leftImage.enabled = false;
}
}
if (rightImage != null)
{ {
if (image != null && if (image != null)
side == DialogSide.Right)
{ {
rightImage.sprite = image; characterImage.sprite = image;
rightImage.enabled = true; characterImage.enabled = true;
} }
else else
{ {
rightImage.enabled = false; characterImage.enabled = false;
} }
} }
} }

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save