Skip to content

Commit

Permalink
07 : 커맨드 구현 (2)
Browse files Browse the repository at this point in the history
https://doublsb.tistory.com/86

- Color, Size 커맨드 오류 해결
- BackText를 스택 구조로 변경
  • Loading branch information
DoublSB committed Apr 13, 2020
1 parent eb891cb commit 5200067
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
3 changes: 0 additions & 3 deletions Assets/DialogAsset/Script/DialogBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ public DialogText(string OriginalText, int size)
PrintText = string.Empty;

Size = size;

Debug.Log(Size);

_convertToCommand();
}

Expand Down
38 changes: 20 additions & 18 deletions Assets/DialogAsset/Script/DialogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void Hide()
//================================================
private void Start()
{
Show("/color:red/^O^/size:down/hi", character);
Show("/emote:Sad/드디어 편안해졌구려./emote:Happy/ 소인, /size:up/감복하였소. /size:init/앞으로도 /color:red/행복 코딩/color:white/이 하고 싶소.", character);
}

private void Initialize(Image image)
Expand Down Expand Up @@ -95,12 +95,15 @@ private IEnumerator Texting(string Text, Character character)
case Command.text:
yield return StartCoroutine(_showText(item.Context));
break;

case Command.color:
_coloring(item.Context);
break;

case Command.emote:
Show_Emotion(item.Context, character);
break;

case Command.size:
_sizing(item.Context);
break;
Expand Down Expand Up @@ -140,28 +143,27 @@ private void _sizing(string Size)
int existIndex = CurrentText.CloseCommands.LastIndexOf(Command.size);
if (existIndex > 0)
{
CurrentText.PrintText += "</size>";
CurrentText.CloseCommands.RemoveAt(existIndex);
}

switch (Size)
{
case "up":
CurrentText.Size += 2;
break;

case "down":
CurrentText.Size -= 5;
break;
switch (Size)
{
case "up":
CurrentText.Size += 10;
break;

case "init":
CurrentText.Size = text.fontSize;
break;
case "down":
CurrentText.Size -= 10;
break;

default:
CurrentText.Size = int.Parse(Size);
break;
}
case "init":
CurrentText.Size = text.fontSize;
break;

CurrentText.PrintText += "</size>";
default:
CurrentText.Size = int.Parse(Size);
break;
}

CurrentText.PrintText += $"<size={CurrentText.Size}>";
Expand Down

0 comments on commit 5200067

Please sign in to comment.