๊ตฌ์กฐ์ฒด๋ฅผ ์•Œ๊ณ ๋‚œ ๋‹ค์Œ๋ถ€ํ„ฐ, ์™ ์ง€ ๊ตฌ์กฐ์ฒด๋ฅผ ๋‚จ๋ฐœํ•˜๋Š”๋“ฏํ•œ ๋А๋‚Œ์ด ๋‚˜๊ธฐ ์‹œ์ž‘ํ•ดย ์ด๊ฒŒ ๋งž๋Š”๊ฑด์ง€ ์˜๋ฌธ์ด ๋“ค๊ธฐ ์‹œ์ž‘ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋Œ€์ถฉ ์œ ๋‹ˆํ‹ฐ์—์„œ ํƒ์ŠคํŠธ ์„ ํƒํ˜• rpg๋ฅผ ๋งŒ๋“ค๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.ย ์ด๊ฑธ ์ด์•ผ๊ธฐ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ธฐย ์‰ฝ๊ฒŒํ•˜๊ธฐ ์œ„ํ•˜์—ฌ ์ฝ”๋“œ๋ฅผ ์งœ๊ณ  ๋ณด๋‹ˆ,..


using UnityEngine;


[CreateAssetMenu(menuName = "Dialogue/DialogueObject")]

public class DialogueObject : ScriptableObject

{

ย  ย  [SerializeField] private StoryInfo[] dialogue;

ย  ย  public StoryInfo[] Dialogue => dialogue;

}


[System.Serializable]

public struct StoryInfo

{

ย  ย  [TextArea] public string story;

ย  ย  public choiceInfo[] choices;

}


[System.Serializable]

public struct choiceInfo

{

ย  ย  [TextArea] public string selection;


ย  ย  public chanceInfo[] chances;

}


[System.Serializable]

public struct chanceInfo

{

ย  ย  public int chance;


ย  ย  public float fortitude;

ย  ย  public float prudence;

ย  ย  public float temperance;

ย  ย  public float justice;

ย  ย  public float fortune;


ย  ย  public int[] storyUnlock;

ย  ย  public int[] storyLock;

ย  ย  public int NextStory;

}


์š”๋Ÿฐ์‹์œผ๋กœ ๋˜์—ˆ๋Š”๋ฐ ํ•œ ๋ณ€์ˆ˜์— ๊ตฌ์กฐ์ฒด๊ฐ€ 3๋ฉ์–ด๋ฆฌ๋‚˜ ๋œ ์ด์ƒํ•œ๋†ˆ์„ ๋งŒ๋“ ๊ฑฐ ๊ฐ™๋‹ค ๋А๊ปด์กŒ์Šต๋‹ˆ๋‹ค.ย ์ด๊ฒƒ์ดย ์ตœ์ ํ™”๋‚˜ ๊ทธ๋Ÿฐ๋ฉด์—์„œ ๊ดœ์ฐฎ์€๊ฑด์ง€ ์ฐพ์•„๋ณด๊ธฐ์œ„ํ•ดย ๊ตฌ์กฐ์ฒด ๋‚จ๋ฐœ๊ฐ™์€ ์‹์œผ๋กœ ๊ฒ€์ƒ‰ํ•ด ๋ดค๋Š”๋ฐ๋„ ์ •ํ™•ํ•œ ๋‹ต์„ ์ž˜ ๋ชจ๋ฅด๊ฒ ์–ด์„œ ์งˆ๋ฌธ ๋“œ๋ฆฝ๋‹ˆ๋‹ค.