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;
}
dialog.ShowDialog(true);
dialog.SetCharacter(character);
dialog.ShowDialog(true);
if (voiceOverClip != null)
{
MusicController.GetInstance().PlaySound(voiceOverClip, 1f);

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

@ -42,9 +42,6 @@ namespace Fungus.Script
typeof(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();
if (characterImage != null &&
@ -68,7 +65,6 @@ namespace Fungus.Script
t.characterName = characterName;
t.characterColor = characterColor;
t.characterImage = characterImage;
t.dialogSide = dialogSide;
}
}

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

@ -10,7 +10,6 @@ namespace Fungus.Script
{
public string characterName;
public Sprite characterImage;
public SayDialog.DialogSide dialogSide;
public Color characterColor;
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 enum DialogSide
{
Left,
Right
};
public float writingSpeed = 60;
public AudioClip writingSound;
public bool loopWritingSound = true;
@ -25,8 +19,7 @@ namespace Fungus.Script
public Canvas dialogCanvas;
public Text nameText;
public Text storyText;
public Image leftImage;
public Image rightImage;
public Image characterImage;
float currentSpeed;
float currentPunctuationPause;
@ -71,47 +64,30 @@ namespace Fungus.Script
{
if (character == null)
{
if (leftImage != null)
leftImage.enabled = false;
if (rightImage != null)
rightImage.enabled = false;
if (characterImage != null)
characterImage.enabled = false;
if (nameText != null)
nameText.text = "";
}
else
{
SetCharacterImage(character.characterImage, character.dialogSide);
SetCharacterImage(character.characterImage);
SetCharacterName(character.name, character.characterColor);
}
}
public void SetCharacterImage(Sprite image, DialogSide side)
public void SetCharacterImage(Sprite image)
{
if (leftImage != null)
{
if (image != null &&
side == DialogSide.Left)
{
leftImage.sprite = image;
leftImage.enabled = true;
}
else
{
leftImage.enabled = false;
}
}
if (rightImage != null)
if (characterImage != null)
{
if (image != null &&
side == DialogSide.Right)
if (image != null)
{
rightImage.sprite = image;
rightImage.enabled = true;
characterImage.sprite = image;
characterImage.enabled = true;
}
else
{
rightImage.enabled = false;
characterImage.enabled = false;
}
}
}

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save