From 849cf63e2e20453973d859e44f7fce8a4066644f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8C=E1=85=B5=E1=84=8B=E1=85=AD=E1=86=BC=E1=84=92?= =?UTF-8?q?=E1=85=AE=E1=86=AB?= <> Date: Sun, 12 Nov 2023 17:29:41 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BA=90=EB=A6=AD=ED=84=B0=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=20=EC=9E=91=EC=84=B1=20=EB=B0=8F=20=EC=8A=A4=ED=82=AC?= =?UTF-8?q?=20=EB=B2=84=EB=B8=94=20=EC=8B=9C=EC=8A=A4=ED=85=9C=20=EC=A0=9C?= =?UTF-8?q?=EC=9E=91=EC=A4=91=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/2_Codes/Battle.meta | 8 ++ Assets/2_Codes/Battle/BattleCharacter.cs | 40 ++++++ Assets/2_Codes/Battle/BattleCharacter.cs.meta | 11 ++ .../2_Codes/Battle/BattleManager+Message.cs | 43 ++++++ .../Battle/BattleManager+Message.cs.meta | 11 ++ Assets/2_Codes/{ => Battle}/BattleManager.cs | 122 +++++++++--------- .../{ => Battle}/BattleManager.cs.meta | 0 Assets/2_Codes/Battle/SkillBubbleManager.cs | 60 +++++++++ .../2_Codes/Battle/SkillBubbleManager.cs.meta | 11 ++ Assets/2_Codes/Battle/SkillData.cs | 34 +++++ Assets/2_Codes/Battle/SkillData.cs.meta | 11 ++ Assets/2_Codes/Model/Character.meta | 8 ++ .../Character/CharacterModel+Controller.cs | 8 ++ .../CharacterModel+Controller.cs.meta | 11 ++ .../2_Codes/Model/Character/CharacterModel.cs | 89 +++++++++++++ .../{ => Character}/CharacterModel.cs.meta | 0 Assets/2_Codes/Model/CharacterModel.cs | 13 -- 17 files changed, 406 insertions(+), 74 deletions(-) create mode 100644 Assets/2_Codes/Battle.meta create mode 100644 Assets/2_Codes/Battle/BattleCharacter.cs create mode 100644 Assets/2_Codes/Battle/BattleCharacter.cs.meta create mode 100644 Assets/2_Codes/Battle/BattleManager+Message.cs create mode 100644 Assets/2_Codes/Battle/BattleManager+Message.cs.meta rename Assets/2_Codes/{ => Battle}/BattleManager.cs (76%) rename Assets/2_Codes/{ => Battle}/BattleManager.cs.meta (100%) create mode 100644 Assets/2_Codes/Battle/SkillBubbleManager.cs create mode 100644 Assets/2_Codes/Battle/SkillBubbleManager.cs.meta create mode 100644 Assets/2_Codes/Battle/SkillData.cs create mode 100644 Assets/2_Codes/Battle/SkillData.cs.meta create mode 100644 Assets/2_Codes/Model/Character.meta create mode 100644 Assets/2_Codes/Model/Character/CharacterModel+Controller.cs create mode 100644 Assets/2_Codes/Model/Character/CharacterModel+Controller.cs.meta create mode 100644 Assets/2_Codes/Model/Character/CharacterModel.cs rename Assets/2_Codes/Model/{ => Character}/CharacterModel.cs.meta (100%) delete mode 100644 Assets/2_Codes/Model/CharacterModel.cs diff --git a/Assets/2_Codes/Battle.meta b/Assets/2_Codes/Battle.meta new file mode 100644 index 00000000..e1f9e0a9 --- /dev/null +++ b/Assets/2_Codes/Battle.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd43d4ef45c8644b29b8f128a42af5a4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2_Codes/Battle/BattleCharacter.cs b/Assets/2_Codes/Battle/BattleCharacter.cs new file mode 100644 index 00000000..72604ce0 --- /dev/null +++ b/Assets/2_Codes/Battle/BattleCharacter.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniRx; + +public class BattleCharacter : MonoBehaviour +{ + public CharacterModel.Data Data { get; private set; } = null; + + public short UID { get; private set; } = 0; + + public int SKILL_TIME { get; private set; } = 0; + + public void Initialize(CharacterModel.Data data, short uid) + { + Data = data; + UID = uid; + SKILL_TIME = 0; + } + + public void UpdateBattleTime(int t) + { + SKILL_TIME += t; + + CheckSkill(); + } + + void CheckSkill() + { + if(Data.GetStat(CharacterModel.Data.eSTAT.SPD) <= SKILL_TIME) + { + MessageBroker.Default.Publish(new BattleManager.Message() + { + BattleEvent = BattleManager.eBATTLE_EVENT.SPAWN_SKILL, + Source = this, + }) ; + SKILL_TIME = 0; + } + } +} diff --git a/Assets/2_Codes/Battle/BattleCharacter.cs.meta b/Assets/2_Codes/Battle/BattleCharacter.cs.meta new file mode 100644 index 00000000..4ab34717 --- /dev/null +++ b/Assets/2_Codes/Battle/BattleCharacter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9da7f45aa275148288c5956311d60b54 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2_Codes/Battle/BattleManager+Message.cs b/Assets/2_Codes/Battle/BattleManager+Message.cs new file mode 100644 index 00000000..8e13ac1c --- /dev/null +++ b/Assets/2_Codes/Battle/BattleManager+Message.cs @@ -0,0 +1,43 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniRx; + +public partial class BattleManager +{ + [SerializeField] + SkillBubbleManager mSkillManager = null; + + public enum eBATTLE_EVENT + { + SPAWN_SKILL, + RUN_SKILL, + } + + public struct Message + { + public eBATTLE_EVENT BattleEvent; + + public BattleCharacter Source; + } + + public void Awake() + { + + + OnMessageBroker(); + } + + void OnMessageBroker() + { + MessageBroker.Default.Receive().Subscribe(msg => + { + switch(msg.BattleEvent) + { + case eBATTLE_EVENT.SPAWN_SKILL: + mSkillManager.SpawnSkill(msg.Source); + break; + } + }).AddTo(this); + } +} diff --git a/Assets/2_Codes/Battle/BattleManager+Message.cs.meta b/Assets/2_Codes/Battle/BattleManager+Message.cs.meta new file mode 100644 index 00000000..686a555e --- /dev/null +++ b/Assets/2_Codes/Battle/BattleManager+Message.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2b35ac764b7a4bf494ec51168810fab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2_Codes/BattleManager.cs b/Assets/2_Codes/Battle/BattleManager.cs similarity index 76% rename from Assets/2_Codes/BattleManager.cs rename to Assets/2_Codes/Battle/BattleManager.cs index e4db1129..f5943c14 100644 --- a/Assets/2_Codes/BattleManager.cs +++ b/Assets/2_Codes/Battle/BattleManager.cs @@ -8,10 +8,10 @@ using DarkTonic.MasterAudio; using System.Collections; #if UNITY_EDITOR -// PackageManager ڵ +// PackageManager ???? ???? #endif -public class BattleManager : MonoBehaviour +public partial class BattleManager : MonoBehaviour { public GameObject HeroUnit; public Transform[] MonsterPositions = new Transform[3]; @@ -21,37 +21,37 @@ public class BattleManager : MonoBehaviour public GameObject NumberPrefab; public GameObject CriticalPrefab; public TextMeshProUGUI stageClearText; - public Image darkPanel; // ũ Ŀư ̹ + public Image darkPanel; // ???? ???? ???????? ???? ???? - public float CriticalRate; // ġŸ Ȯ(10000) - public float CriticalDamage; // ġŸ (10000) - public int HeroDamag; // ݷ + public float CriticalRate; // ?????? ????(10000????) + public float CriticalDamage; // ?????? ????(10000????) + public int HeroDamag; // ???? ?????? private List aliveMonsters = new List(); private bool stageCleared = false; private bool isHeroAttacking = false; public string playlistName = "Bgm"; - // Ʈ 迭 ߰ + // ?????????? ?????? ???? ???? private SpriteRenderer[] spriteRenderers; private void Start() { - // ó ͸ Ʈ ߰ + // ?????? ???? ???????? ???? ?????? ???????? ???? foreach (Transform monsterPos in MonsterPositions) { aliveMonsters.Add(monsterPos); } - // NumberPrefab ڽ Ʈ ɴϴ. + // NumberPrefab?? ???? ???????? ???? ??????????. int childCount = NumberPrefab.transform.childCount; - // Ʈ 迭 ʱȭ + // ?????????? ?????? ???? ?????? spriteRenderers = new SpriteRenderer[childCount]; - // ڽ Ʈ Ʈ Ʈ 迭 Ҵ + // ?? ???? ?????????? ?????????? ?????? ?????????? ?????? ???? for (int i = 0; i < childCount; i++) { Transform child = NumberPrefab.transform.GetChild(i); @@ -78,18 +78,18 @@ public class BattleManager : MonoBehaviour isHeroAttacking = true; HeroUnit.SetActive(true); - // ִϸ̼ + // ?????? ???? ?????????? Sequence attackSequence = DOTween.Sequence(); attackSequence.Append(HeroUnit.transform.DOLocalMoveY(-700, 0.25f).SetEase(Ease.OutCubic)); attackSequence.AppendCallback(() => { - // ִϸ̼ Ϳ ظ ϴ. + // ???? ???????????? ?????? ?????????? ?????? ????????. DealDamageToMonster(); }); attackSequence.Append(HeroUnit.transform.DOLocalMoveY(-1500, 0.15f).SetEase(Ease.OutCubic)); attackSequence.OnComplete(() => { - // ִϸ̼ + // ?????????? ???? ?? ?????? ???? isHeroAttacking = false; HeroUnit.SetActive(false); }); @@ -104,24 +104,24 @@ public class BattleManager : MonoBehaviour int randomMonsterIndex = Random.Range(0, aliveMonsters.Count); Transform targetMonster = aliveMonsters[randomMonsterIndex]; - float randomNumber = Random.Range(0, HeroDamag); // 0 ݷ¸ŭ ظ + float randomNumber = Random.Range(0, HeroDamag); // 0???? ???? ???????????? ?????? ???? - // Ͽ ũƼ Ȯ - float randomValue = Random.Range(0, 10000); // 0 9999 + // ???? ???? ???????? ???????? ?????? ???? + float randomValue = Random.Range(0, 10000); // 0???? 9999?????? ???? ?? bool isCritical = randomValue<= CriticalRate; int resultNumber = 0; - int randomSoundIndex = Random.Range(1, 4); // 1 3 + int randomSoundIndex = Random.Range(1, 4); // 1???? 3?????? ?????? ???? ???? - string soundName = "Hot_Type2_" + randomSoundIndex.ToString(); // ̸ + string soundName = "Hot_Type2_" + randomSoundIndex.ToString(); // ?????? ???? ???? MasterAudio.PlaySound(soundName, 0.7f, null); - int randomVoiceIndex = Random.Range(1, 13); // 1 12 + int randomVoiceIndex = Random.Range(1, 13); // 1???? 12?????? ?????? ???? ???? - string voiceName = "Voice_HERO_01_Combo_1_" + randomVoiceIndex.ToString(); // ̸ + string voiceName = "Voice_HERO_01_Combo_1_" + randomVoiceIndex.ToString(); // ?????? ???? ???? MasterAudio.PlaySound(voiceName, 0.7f, null); @@ -138,32 +138,32 @@ public class BattleManager : MonoBehaviour resultNumber = (int)randomNumber; } - // HitEffectPrefab Ʈ Ͽ Ʈ ǥ Ʈ + // HitEffectPrefab ?????????? ???????? ???????? ?????? ???????? ???? GameObject hitEffectPosition = Instantiate(HitEffectPrefab, targetMonster.position, Quaternion.identity); hitEffectPosition.SetActive(true); - Destroy(hitEffectPosition, 0.5f); // ð Ŀ + Destroy(hitEffectPosition, 0.5f); // ???? ???? ???? ???? if (resultNumber == 0) { - // ġ ̽ Ʈ ߻ + // ?????? ?????? ???? ?????? ???? ShowMissDamage(targetMonster.position + new Vector3(0, 1.4f, 0), targetMonster); } else { ShowNumberDamage(targetMonster.position + new Vector3(0, 1.4f, 0), targetMonster, resultNumber, isCritical); - // HitEffectPrefab Ʈ Ͽ Ʈ ǥ Ʈ + // HitEffectPrefab ?????????? ???????? ???????? ?????? ???????? ???? } } } private void ShowMissDamage(Vector3 monsterPosition, Transform targetMonster) { - // ġ ̽ Ʈ + // ?????? ?????? ???? ?????? ???? GameObject missObject = Instantiate(MissPrefab, monsterPosition, Quaternion.identity); missObject.SetActive(true); - // ̽ ִϸ̼ + // ???? ?????????? missObject.transform.localScale = Vector3.one * 1.5f; missObject.transform.DOScale(Vector3.one * 0.3f, 0.4f).SetEase(Ease.OutCubic); missObject.transform.DOMoveY(missObject.transform.position.y + 1, 0.5f).SetEase(Ease.OutCubic).OnComplete(() => @@ -177,7 +177,7 @@ public class BattleManager : MonoBehaviour GameObject CriObject = Instantiate(CriticalPrefab, monsterPosition, Quaternion.identity); CriObject.SetActive(true); - // ũ ִϸ̼ + // ???? ?????????? CriObject.transform.localScale = Vector3.one * 1.5f; CriObject.transform.DOScale(Vector3.one * 0.3f, 0.4f).SetEase(Ease.OutCubic); CriObject.transform.DOMoveY(CriObject.transform.position.y + 1, 0.5f).SetEase(Ease.OutCubic).OnComplete(() => @@ -188,13 +188,13 @@ public class BattleManager : MonoBehaviour private void ShowNumberDamage(Vector3 monsterPosition, Transform targetMonster, int damage, bool isCritical) { - // ȿ ߰ + // ???? ???? ???? targetMonster.DOPunchPosition(new Vector3(10, 0, 0), 0.2f); - // damage ڿ ȯ + // damage?? ???????? ???? string damageString = damage.ToString(); - // ġ + // ???? ?????? ???? ?????? float xOffset = 0; if (isCritical) @@ -206,18 +206,18 @@ public class BattleManager : MonoBehaviour xOffset += 1.1f; } - float totalWidth = ((damageString.Length-1) * xOffset); // ü ʺ + float totalWidth = ((damageString.Length-1) * xOffset); // ???? ???? - // θ Ʈ + // ???? ???????? ???? GameObject digitObject = new GameObject("HitNumber"); - // ġ monsterPosition ( ) + // ???? ?????? monsterPosition?? ???????? ???? (???? ??????) digitObject.transform.localPosition = new Vector3(monsterPosition.x, monsterPosition.y - 2f, monsterPosition.z); - // ִϸ̼ ġ + // ?????????? ?? ???? ???? for (int i = 0; i < damageString.Length; i++) { - int digit = int.Parse(damageString[i].ToString()); // ڸ + int digit = int.Parse(damageString[i].ToString()); // ???????? ???? if (digit >= 0 && digit < spriteRenderers.Length) { @@ -225,28 +225,28 @@ public class BattleManager : MonoBehaviour { digit += 10; } - // Ʈ + // ???? ?????????? ?????? ???? SpriteRenderer digitSpriteRenderer = spriteRenderers[digit]; - // Ʈ - GameObject digitImageObject = new GameObject("DigitImage"); // Ʈ + // ???? ?????????? ???? + GameObject digitImageObject = new GameObject("DigitImage"); // ?? ???? ???????? ???? //digitImageObject.transform.position = digitObject.transform.position; - // Ʈ ߰ + // ?????????? ?????? ???? ?? ???? SpriteRenderer newRenderer = digitImageObject.AddComponent(); newRenderer.sprite = digitSpriteRenderer.sprite; - // Order 300 + // Order ???? 300???? ???? newRenderer.sortingOrder = 300; - // x ġ Ͽ ߾ ĵ ¿ ġ + // x ???? ???????? ???? ?????? ???????? ???? float xPos = -totalWidth / 2 + i * xOffset; digitImageObject.transform.localPosition = new Vector3(xPos, 0, 0); - // (ũ ϰ) + // ?????? ???? (???? ????????) digitImageObject.transform.localScale = Vector3.one * 1.0f; - // θ + // ???? ???? digitImageObject.transform.SetParent(digitObject.transform); } else @@ -257,39 +257,39 @@ public class BattleManager : MonoBehaviour if (isCritical) { ShowCriEffect(targetMonster.position + new Vector3(0, 1.8f, 0), targetMonster); - digitObject.transform.localScale = Vector3.one * 0.5f; // ũ + digitObject.transform.localScale = Vector3.one * 0.5f; // ???? ???? digitObject.transform.DOScale(Vector3.one * 0.2f, 0.3f).SetEase(Ease.OutCubic); digitObject.transform.DOMoveY(digitObject.transform.position.y + 2, 0.5f).SetEase(Ease.OutCubic).OnComplete(() => { - Destroy(digitObject); // Ʈ Ʈ մϴ. + Destroy(digitObject); // ?????????? ???????? ???? ???? ?????????? ??????????. }); } else { - // digitObject ִϸ̼ - digitObject.transform.localScale = Vector3.one * 0.5f; // ũ + // digitObject?? ???????? ?????????? ???? + digitObject.transform.localScale = Vector3.one * 0.5f; // ???? ???? digitObject.transform.DOScale(Vector3.one * 0.3f, 0.3f).SetEase(Ease.OutCubic); digitObject.transform.DOMoveY(digitObject.transform.position.y + 2, 0.5f).SetEase(Ease.OutCubic).OnComplete(() => { - Destroy(digitObject); // Ʈ Ʈ մϴ. + Destroy(digitObject); // ?????????? ???????? ???? ???? ?????????? ??????????. }); } - // HP ó + // ???????? HP ?????? ???? ???? MonsterHealth monsterHealth = targetMonster.GetComponentInChildren(); if (monsterHealth != null && !monsterHealth.IsDead) { - monsterHealth.TakeDamage(damage); // damage ŭ + monsterHealth.TakeDamage(damage); // damage ???? ???? - // HP 0 ϸ + // ???? ???????? HP?? 0 ?????? if (monsterHealth.CurrentHealth <= 0) { - // ͸ Ʈ + // ???????? ?????????? ???? aliveMonsters.Remove(targetMonster); - // Ͱ StageClear ȿ ǥ + // ???? ???????? ?????? StageClear ???? ???? if (aliveMonsters.Count == 0 && !stageCleared) { stageCleared = true; @@ -305,31 +305,31 @@ public class BattleManager : MonoBehaviour private void ShowStageClearAnimation() { - // ؽƮ Ȱȭ ʱȭ + // ?????? ?????? ?? ?????? stageClearText.gameObject.SetActive(true); HeroUnit.SetActive(false); stageClearText.transform.localScale = Vector3.zero; - // Scale ִϸ̼ + // Scale ?????????? stageClearText.transform.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBack).OnComplete(() => { - // ؽƮ 鸲 ִϸ̼ + // ?????? ?????? ?????????? stageClearText.transform.DOShakePosition(1.0f, new Vector3(0, 10, 0), 10, 90, false, true).OnComplete(() => { - // ؽƮ ̵ ƿ ִϸ̼ + // ?????? ?????? ???? ?????????? CanvasGroup canvasGroup = stageClearText.GetComponent(); canvasGroup.DOFade(0, 0.5f).OnComplete(() => { - // ũ Ŀư ̹ Ȱȭ + // ???? ???? ?????? ?????? darkPanel.gameObject.SetActive(true); - // ο ȿ ִϸ̼ ( 0 1 ) + // ?????? ???? ?????????? (???????? 0???? 1?? ????) DOVirtual.Float(0, 1.0f, 1.0f, (fadeValue) => { darkPanel.color = new Color(0, 0, 0, fadeValue); }).OnComplete(() => { - // ȣ + // ???? ?? ???? MasterAudio.PlaySound("BGM_VAILAGE", 0); MasterAudio.PlaylistsMuted = false; SceneManager.LoadScene(4); diff --git a/Assets/2_Codes/BattleManager.cs.meta b/Assets/2_Codes/Battle/BattleManager.cs.meta similarity index 100% rename from Assets/2_Codes/BattleManager.cs.meta rename to Assets/2_Codes/Battle/BattleManager.cs.meta diff --git a/Assets/2_Codes/Battle/SkillBubbleManager.cs b/Assets/2_Codes/Battle/SkillBubbleManager.cs new file mode 100644 index 00000000..41a95ed0 --- /dev/null +++ b/Assets/2_Codes/Battle/SkillBubbleManager.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System.Linq; + +public class SkillBubbleManager : MonoBehaviour +{ + public List mListSkill = new List(10); + + Queue mQSkillDataPool = new Queue(10); + + public void Initialize() + { + for(int i=0; i<10; ++i) + { + mQSkillDataPool.Enqueue(new SkillData()); + } + } + + public void SpawnSkill(BattleCharacter character) + { + var existSkill = GetExistSkill(character); + if(null != existSkill) + { + existSkill.OnStack(); + return; + } + + var newSkill = GetNewSkillData(); + newSkill.Set(character); + mListSkill.Add(newSkill); + } + + public void RemoveSkill(int idx) + { + mListSkill.RemoveAt(idx); + } + + SkillData GetExistSkill(BattleCharacter character) + { + var skill = mListSkill.FirstOrDefault((item) => item.Owner == character); + if (null == skill) + return null; + + if (false == skill.IsStackable()) + return null; + + return skill; + } + + SkillData GetNewSkillData() + { + if (mQSkillDataPool.Count <= 0) + { + mQSkillDataPool.Enqueue(new SkillData()); + } + + return mQSkillDataPool.Dequeue(); + } +} diff --git a/Assets/2_Codes/Battle/SkillBubbleManager.cs.meta b/Assets/2_Codes/Battle/SkillBubbleManager.cs.meta new file mode 100644 index 00000000..d4b93e7f --- /dev/null +++ b/Assets/2_Codes/Battle/SkillBubbleManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 576636a482c29486cb2a622bcb12b953 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2_Codes/Battle/SkillData.cs b/Assets/2_Codes/Battle/SkillData.cs new file mode 100644 index 00000000..bd4e154d --- /dev/null +++ b/Assets/2_Codes/Battle/SkillData.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SkillData +{ + public const int MAX_STACK = 5; + + public BattleCharacter Owner { get; private set; } = null; + public int StackCnt { get; set; } = 0; + + public void Reset() + { + Owner = null; + StackCnt = 1; + } + + public void Set(BattleCharacter owner) + { + Owner = owner; + StackCnt = 1; + } + + public bool IsStackable() + { + return StackCnt < MAX_STACK; + } + + public void OnStack() + { + StackCnt++; + } + +} diff --git a/Assets/2_Codes/Battle/SkillData.cs.meta b/Assets/2_Codes/Battle/SkillData.cs.meta new file mode 100644 index 00000000..f0330b65 --- /dev/null +++ b/Assets/2_Codes/Battle/SkillData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fedc6dc1b6439435586cf6bf5259ab37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2_Codes/Model/Character.meta b/Assets/2_Codes/Model/Character.meta new file mode 100644 index 00000000..20acbcf5 --- /dev/null +++ b/Assets/2_Codes/Model/Character.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e4f2a12c7a4454e4fa2e2b23f2a9dc4b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2_Codes/Model/Character/CharacterModel+Controller.cs b/Assets/2_Codes/Model/Character/CharacterModel+Controller.cs new file mode 100644 index 00000000..6905b8c9 --- /dev/null +++ b/Assets/2_Codes/Model/Character/CharacterModel+Controller.cs @@ -0,0 +1,8 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public partial class CharacterModel +{ + +} diff --git a/Assets/2_Codes/Model/Character/CharacterModel+Controller.cs.meta b/Assets/2_Codes/Model/Character/CharacterModel+Controller.cs.meta new file mode 100644 index 00000000..9fec3746 --- /dev/null +++ b/Assets/2_Codes/Model/Character/CharacterModel+Controller.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8dc698d1cb2fa4b6ebfb636046a6fe33 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/2_Codes/Model/Character/CharacterModel.cs b/Assets/2_Codes/Model/Character/CharacterModel.cs new file mode 100644 index 00000000..95467a56 --- /dev/null +++ b/Assets/2_Codes/Model/Character/CharacterModel.cs @@ -0,0 +1,89 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UniRx; + + +public partial class CharacterModel : BaseModel +{ + + ReactiveCollection mDatas = new ReactiveCollection(new List(10)); + public IReadOnlyCollection Datas => mDatas; + + + public class Data + { + public enum eSTAT + { + _START_, + _BASE_START_, + ATK, //공격력 + DEF, //방어력 + HP, //체력 + CRI_RATE, //치명타 확률 + CRI, //치명타 피해량 + SPD, //속도 + _BASE_END_, + + _SUPPROT_START_, + SKILL_DMG, //스킬 피해량 + CC_REGIST, //상태이상 저항 + CC_HIT, //상태이상 적중 + FINAL_DMG_UP, //최종 피해량 증가 + FINAL_DMG_DOWN, //받는 피해 경감 + FIX_DMG_UP, //고정 피해 추가 + FIX_DMG_DOWN, //고정 피해 방어 + CRI_REGIST, //치명타 저항 + HP_RECOVERY, //생명력 재생량 + HP_RECOVERY_UP, //회복 효과 증가 + _SUPPORT_END_, + + _SPECIAL_START_, + ATTRIBUTE, //속성 + JOB, //직업 + SEX, //성별 + AGGRO, //어그로 + _SPECIAL_END_, + _END_, + } + + public int Level { get; set; } = 1; + public string Name { get; set; } = string.Empty; + + public int SkillID { get; set; } = 0; + + Dictionary mDicStat = null; + + public Data() + { + mDicStat = new Dictionary((int)eSTAT._END_); + } + + public void Initialize() + { + #region [TEST] + for (var e = eSTAT._START_; e <= eSTAT._END_; ++ e) + { + if(e <= eSTAT._BASE_END_) + { + mDicStat.TryAdd(e, Random.Range(100, 150)); + } + else if(e <= eSTAT._SUPPORT_END_) + { + mDicStat.TryAdd(e, Random.Range(1, 10)); + } + else if(e <= eSTAT._SPECIAL_END_) + { + mDicStat.TryAdd(e, Random.Range(1, 5)); + } + } + #endregion[TEST] + } + + public int GetStat(eSTAT e) + { + mDicStat.TryGetValue(e, out var stat); + return stat; + } + } +} \ No newline at end of file diff --git a/Assets/2_Codes/Model/CharacterModel.cs.meta b/Assets/2_Codes/Model/Character/CharacterModel.cs.meta similarity index 100% rename from Assets/2_Codes/Model/CharacterModel.cs.meta rename to Assets/2_Codes/Model/Character/CharacterModel.cs.meta diff --git a/Assets/2_Codes/Model/CharacterModel.cs b/Assets/2_Codes/Model/CharacterModel.cs deleted file mode 100644 index 78efe192..00000000 --- a/Assets/2_Codes/Model/CharacterModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UniRx; - -public class CharacterModel : BaseModel -{ - public IntReactiveProperty mLevel = new IntReactiveProperty(0); - public IReadOnlyReactiveProperty Level => mLevel; - - - -}