์กธ์ ์ํ์ผ๋ก ์ ์ถํ ์ ๋ํฐ ๊ฒ์ ๊ฐ๋ฐ ํ๋ก์ ํธ
2024.9. ~ 2024.11. (3๊ฐ์)
| ์ด๋ฆ | ์ญํ |
|---|---|
| ๊ณ ์ฑํ | ๊ธฐํ+๊ฐ๋ฐ |
| ๊น์ํ | ์บ๋ฆญํฐ 3D ๋ชจ๋ธ๋ง |
| ์ ํ์ | ๋ฐฐ๊ฒฝ 3D ๋ชจ๋ธ๋ง |
Unity | C#
https://blog.naver.com/cgko321/223679401063
- Unity 2022.3.44f1 ๋ฒ์ ์ ์ ๋ํฐ๋ฅผ ์ค์นํ๋ค.
- ํด๋น ํ๋ก์ ํธ๋ฅผ ์ปดํจํฐ๋ก ๋ด๋ ค๋ฐ๋๋ค.
- ํ๋ก์ ํธ๋ฅผ ์ด๊ณ , ํจํค์ง ๋งค๋์ ์์ ์๋์ ์์ ๋ค์ ์ํฌํธํ๋ค.
- Ancient City Ruins
- AllSky - 220+ Sky / Skybox Set
- Creep Horror Creature
- Epic Toon FX
- 5800 Fantasy RPG Icons Pack
- Joystick Pack
- Medieval Kingdom UI
- Morbid Creatures: Mutant 1
- Nodachi AnimSet
- Magic Slashes FX
- Ultimate Game Music Collection
- Ultimate Sound FX Bundle
- Unity-Chan! Model
- Zombie
- Hungry Zombie
| ๊ฒฝ๋ก | ์ฉ๋ |
|---|---|
| Assets \ Infection | ์์ ์ด ์ด๋ฃจ์ด์ง๋ ํด๋ |
| Assets \ ... | ์์ ๋ฆฌ์์ค/ํ๋ก์ ํธ ์ค์ ๋ฑ์ ํด๋ |
| ๊ฒฝ๋ก | ์ฉ๋ |
|---|---|
| Assets \ Infection \ Animations | ์ ๋๋ฉ์ดํฐ/์ ๋๋ฉ์ด์ ํด๋ |
| Assets \ Infection \ Audios | ์ฌ์ด๋ ํด๋ |
| Assets \ Infection \ Fonts | ํฐํธ ํด๋ |
| Assets \ Infection \ Images | ์ด๋ฏธ์ง ํด๋ |
| Assets \ Infection \ Materials | ์ฌ๋ฃ ํด๋ |
| Assets \ Infection \ Models | 3D ๋ชจ๋ธ ํด๋ |
| Assets \ Infection \ Particles | ํํฐํด ํด๋ |
| Assets \ Infection \ Prefabs | ํ๋ฆฌํน ํด๋ |
| Assets \ Infection \ Scenes | ์ฌ ํด๋ |
| Assets \ Infection \ Scripts | ์คํฌ๋ฆฝํธ ํด๋ |
| ์ด๋ฆ | ์ฉ๋ |
|---|---|
| Title | ๊ฒ์์ ์ฒ์ ์คํํ์ ๋, ๋ณด์ฌ์ง๋ ํ๋ฉด |
| Main | ๊ฒ์์ ๋ฉ์ธ์ด ๋๋ ํ๋ฉด (๊ฒ์ ์์/์ค์ ๋ฒํผ ๋ฑ์ด ์์) |
| Room | ์ค์ ๋ก ํ๋ ์ด๊ฐ ์งํ๋๋ ํ๋ฉด |
๋งต์ ๋ฐฐ์น๋์ด ํน์ ๊ธฐ๋ฅ์ ์คํํ๋ ํด๋์ค ๋ชจ์
| ํด๋์ค | ์ฉ๋ |
|---|---|
| Spawner \ ... | ์ํ ํด๋์ค ๋ชจ์ |
| Spawner \ MonsterSpawner | ๋ชฌ์คํฐ ์ํ ํด๋์ค |
| System \ ... | ์์คํ ํด๋์ค ๋ชจ์ |
| System \ WaveSystem | ์จ์ด๋ธ ์์คํ ํด๋์ค |
์นด๋ฉ๋ผ ํด๋์ค ๋ชจ์
| ํด๋์ค | ์ฉ๋ |
|---|---|
| CameraRatio | ํ๋ฉด ๋น์จ ์๋ ์กฐ์ ํด๋์ค |
| MainSceneCameraMovement | ๋ฉ์ธ ์ฌ ์นด๋ฉ๋ผ ์์ง์ ํด๋์ค |
ํ๋ ์ด์ด/๋ชฌ์คํฐ ๋ฑ ๊ฐ์ฒด ํด๋์ค ๋ชจ์
| ํด๋์ค | ์ฉ๋ |
|---|---|
| Effect \ ... | ํจ๊ณผ ํด๋์ค ๋ชจ์ |
| Effect \ AuraReleaseEffect | ์ค๋ฌ๋ฐฉ์ถ ํจ๊ณผ ํด๋์ค |
| Effect \ BarrierEffect | ๋ฐฉ๋ฒฝ ํจ๊ณผ ํด๋์ค |
| Effect \ ElectricSlashEffect | ์ ๊ธฐ ์ฌ๋์ ํจ๊ณผ ํด๋์ค |
| Effect \ FlameThrowerEffect | ํ์ผ ๋ฐฉ์ฌ ํจ๊ณผ ํด๋์ค |
| Effect \ FlareSlash | ๋ถ๊ฝ ํจ๊ณผ ํด๋์ค |
| Effect \ GasEffect | ๊ฐ์ค ํจ๊ณผ ํด๋์ค |
| Effect \ GatheringAuraEffect | ์ค๋ฌ๋ฐฉ์ถ ์์ ํจ๊ณผ ํด๋์ค |
| Effect \ HealingAreaEffect | ์น์ ์์ญ ํจ๊ณผ ํด๋์ค |
| Effect \ HealingEffect | ์น์ ํจ๊ณผ ํด๋์ค |
| Effect \ HighSpeedEffect | ๋น ๋ฅธ ์๋ ํจ๊ณผ ํด๋์ค |
| Effect \ JumpDownEffect | ์ ํ ๋ค์ด ํจ๊ณผ ํด๋์ค |
| Effect \ JumpUpEffect | ์ ํ ์ ํจ๊ณผ ํด๋์ค |
| Effect \ LightningStrikeEffect | ๋ฒ๊ฐ ํจ๊ณผ ํด๋์ค |
| Effect \ MagicCircleEffect | ๋ง๋ฒ ์ํ์ง ํจ๊ณผ ํด๋์ค |
| Effect \ PheonixEffect | ๋ถ์ฌ์กฐ ํจ๊ณผ ํด๋์ค |
| Effect \ VenomExplosionEffect | ๋ ํญ๋ฐ ํจ๊ณผ ํด๋์ค |
| Exp \ ... | ๊ฒฝํ์น ํด๋์ค ๋ชจ์ |
| Exp \ Exp | ๊ฒฝํ์น ํด๋์ค |
| LivingEntity \ ... | ์๋ช ์ฒด ํด๋์ค ๋ชจ์ |
| LivingEntity \ Monster \ ... | ๋ชฌ์คํฐ ํด๋์ค ๋ชจ์ |
| LivingEntity \ Monster \ Creep \ ... | ํฌ๋ฆฝ ๋ชฌ์คํฐ ํด๋์ค ๋ชจ์ |
| LivingEntity \ Monster \ Creep \ Creep | ํฌ๋ฆฝ ๋ชฌ์คํฐ ํด๋์ค |
| LivingEntity \ Monster \ Venom \ ... | ๋ฒ ๋ ๋ชฌ์คํฐ ํด๋์ค ๋ชจ์ |
| LivingEntity \ Monster \ Venom \ Venom | ๋ฒ ๋ ๋ชฌ์คํฐ ํด๋์ค |
| LivingEntity \ Monster \ Zombie \ ... | ์ข๋น ๋ชฌ์คํฐ ํด๋์ค ๋ชจ์ |
| LivingEntity \ Monster \ Zombie \ GrayZombie \ ... | ๊ทธ๋ ์ด ์ข๋น ๋ชฌ์คํฐ ํด๋์ค ๋ชจ์ |
| LivingEntity \ Monster \ Zombie \ GrayZombie \ GrayZombie | ๊ทธ๋ ์ด ์ข๋น ๋ชฌ์คํฐ ํด๋์ค |
| LivingEntity \ Monster \ Zombie \ RedZombie \ ... | ๋ ๋ ์ข๋น ๋ชฌ์คํฐ ํด๋์ค ๋ชจ์ |
| LivingEntity \ Monster \ Zombie \ RedZombie \ RedZombie | ๋ ๋ ์ข๋น ๋ชฌ์คํฐ ํด๋์ค |
| LivingEntity \ Monster \ Zombie \ Zombie | ์ข๋น ๋ชฌ์คํฐ ํด๋์ค |
| LivingEntity \ Player \ ... | ํ๋ ์ด์ด ํด๋์ค ๋ชจ์ |
| LivingEntity \ Player \ Ability \ ... | ๋ฅ๋ ฅ ํด๋์ค ๋ชจ์ |
| LivingEntity \ Player \ Ability \ AuraReleaseAbility | ์ค๋ฌ๋ฐฉ์ถ ๋ฅ๋ ฅ ํด๋์ค |
| LivingEntity \ Player \ Ability \ BarrierAbility | ๋ฐฉ๋ฒฝ ๋ฅ๋ ฅ ํด๋์ค |
| LivingEntity \ Player \ Ability \ ElectricWhirlwindAbility | ์ ๊ธฐํญํ ๋ฅ๋ ฅ ํด๋์ค |
| LivingEntity \ Player \ Ability \ HealingArea | ์น์ ์์ญ ๋ฅ๋ ฅ ํด๋์ค |
| LivingEntity \ Player \ Ability \ IAbility | ๋ฅ๋ ฅ ์ธํฐํ์ด์ค |
| LivingEntity \ Player \ Ability \ PheonixSlashAbility | ๋ถ์ฌ์กฐ ๋ฅ๋ ฅ ํด๋์ค |
| LivingEntity \ Player \ Ability \ RollingAbility | ๊ตฌ๋ฅด๊ธฐ ๋ฅ๋ ฅ ํด๋์ค |
| LivingEntity \ Player \ Player | ํ๋ ์ด์ด ํด๋์ค |
| LivingEntity \ Player \ PlayerAbility | ํ๋ ์ด์ด ๋ฅ๋ ฅ ํด๋์ค |
| LivingEntity \ Player \ PlayerInput | ํ๋ ์ด์ด ์ ๋ ฅ ํด๋์ค |
| LivingEntity \ Player \ PlayerMovement | ํ๋ ์ด์ด ์ด๋ ํด๋์ค |
์ฌ ๋ณ๋ก ํ๋๋ง ์กด์ฌํ๋ ๊ด๋ฆฌ ํด๋์ค ๋ชจ์
| ํด๋์ค | ์ฉ๋ |
|---|---|
| MainSceneManager | ๋ฉ์ธ ์ฌ ๊ด๋ฆฌ ํด๋์ค |
| RoomSceneManager | ๋ฃธ ์ฌ ๊ด๋ฆฌ ํด๋์ค |
| TitleSceneManager | ํ์ดํ ์ฌ ๊ด๋ฆฌ ํด๋์ค |
๋์์ธ ํจํด ์ฝ๋๊ฐ์ ๊ธฐํ ํด๋์ค ๋ชจ์
| ํด๋์ค | ์ฉ๋ |
|---|---|
| Singleton | ์ฑ๊ธํค ํจํด ๊ตฌ์กฐ ์์ฑ ํด๋์ค |
์์ฃผ ์ฌ์ฉ๋๋ ๊ธฐ๋ฅ๋ค์ ํจ์๋ก ๋ฌถ์ ํด๋์ค ๋ชจ์
| ํด๋์ค | ์ฉ๋ |
|---|---|
| AnimationUtility | ์ ๋๋ฉ์ด์ ๊ธฐ๋ฅ ํด๋์ค |
| BGMUtility | BGM ๊ธฐ๋ฅ ํด๋์ค |
| CoroutineUtility | ์ฝ๋ฃจํด ๊ธฐ๋ฅ ํด๋์ค |
| DisplayUtility | ํ๋ฉด ๊ธฐ๋ฅ ํด๋์ค |
| LoadUtility | ๋ก๋ฉ ๊ธฐ๋ฅ ํด๋์ค |
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour {
private static T instance;
public static T Instance {
get {
if (instance == null) {
instance = (T) FindObjectOfType(typeof(T));
if (instance == null) {
GameObject gameObject = new GameObject(typeof(T).Name, typeof(T));
instance = gameObject.GetComponent<T>();
}
}
return instance;
}
}
}์ฑ๊ธํค ํจํด์ ์์์ ํตํด ์ฌ์ฉํ ์ ์๊ฒ ๋ง๋ ์ฝ๋์ด๋ค.
์ ๋๋ฆญ๊ณผ ์ ์ฝ์กฐ๊ฑด where์ ํ์ฉํด์ ๋ง๋ ์ฝ๋๋ก,
MonoBehaviour ํด๋์ค๋ฅผ ์์๋ฐ๊ณ ์๋ ํด๋์ค๋ผ๋ฉด ํด๋น ์ฝ๋๋ฅผ ์์๋ฐ์ ์ฌ์ฉํ ์ ์๋ค.
์
๋ ฅ๋ ํ์
์ ๊ฐ์ง ๊ฐ์ฒด๋ฅผ ์ฐพ๊ณ , ์์ผ๋ฉด ๊ฐ์ฒด๋ฅผ ์๋ก ์์ฑํ์ฌ, instance ๋ณ์์ ์ด๊ธฐํํ๋ ๋ฐฉ์์ด๋ค.
ํ๋ ์ด์ด์ ๋ฅ๋ ฅ์ '๋ฅ๋ ฅ ์์ โ ๋ฅ๋ ฅ ํจ๊ณผ ์์ฑ โ ํจ๊ณผ ๊ธฐ๋ฅ ์ํ' ๋จ๊ณ๋ฅผ ๊ฑฐ์ณ์ ์ํ๋๋ค.
์ด์ ๋ง์ถฐ ํด๋์ค ์ญ์ 3๊ตฌ์ญ(PlayerAbility, Ability, Effect)์ผ๋ก ๋๋์๋ค.
| ๊ตฌ์ญ | ์ฉ๋ |
|---|---|
| Entity \ LivingEntity \ Player \ PlayerAbility.cs | ๋ฅ๋ ฅ์ ์ค๋ช /์์ด์ฝ์ด ๋ด๊ฒจ ์๊ณ , ๋ฅ๋ ฅ ์ ํ ๊ธฐ๋ฅ์ ์ํ |
| Entity \ LivingEntity \ Player \ Ability \ ...Ability.cs | ๋ฅ๋ ฅ์ ์ฌ์ฌ์ฉ ๋๊ธฐ ์๊ฐ/์์ ์๋๊ฐ ๋ด๊ฒจ ์๊ณ , ๋ฅ๋ ฅ ์ฌ์ฉ ์ ์ ๋๋ฉ์ด์ ์ฌ์/์์ ํจ๊ณผ์ ์ฌ์/๋ฅ๋ ฅ ํจ๊ณผ ์์ฑ์ ์ํ |
| Entity \ Effect \ ...Effect.cs | ๋ฅ๋ ฅ ํจ๊ณผ์ ํฌ๊ธฐ/ํผํด๋ ๋ฑ์ด ๋ด๊ฒจ ์๊ณ , ๋ฅ๋ ฅ ํจ๊ณผ์ ์ถฉ๋ ๊ฐ์ง ํ ํผํด๋ฅผ ๊ฐํ๋ ๊ธฐ๋ฅ์ ์ํ |
3๊ตฌ์ญ์ผ๋ก ๋๋์ด์ ๊ตฌํํ์๊ธฐ์,
๋ฅ๋ ฅ๋ณ๋ก ์ ๋๋ฉ์ด์
/ํจ๊ณผ์/ํจ๊ณผ/ํจ๊ณผ ๊ธฐ๋ฅ์ด ๋ค๋ฅด๋๋ผ๋ ๋์ํ์ฌ ๊ฐ๋ฐํ ์ ์๋ค.
์นด๋ฉ๋ผ๊ฐ ํ๋ ์ด์ด๋ฅผ ์ถ์ ํ ์ ์๋๋ก ์๋์ ๊ฐ์ด ์ฝ๋๋ฅผ ์์ฑํ์๋ค.
using UnityEngine;
public class PlayerMovement : MonoBehaviour {
// ์นด๋ฉ๋ผ ์ถ์
public void FollowCamera(Player player, Vector3 cameraPosition) {
Vector3 position = player.transform.position;
player.Camera.transform.position = Vector3.Lerp(cameraPosition, new Vector3(
position.x + player.cameraOffsetPosition.x,
position.y + player.cameraOffsetPosition.y,
position.z + player.cameraOffsetPosition.z
), player.CameraFollowSpeed * Time.deltaTime);
}
...
}Vector3.Lerp()๋ฅผ ์ฌ์ฉํ์ฌ ์นด๋ฉ๋ผ๊ฐ ๋ถ๋๋ฝ๊ฒ ํ๋ ์ด์ด๋ฅผ ๋ฐ๋ผ๊ฐ๋๋ก ๊ตฌํํ์๋ค.
์นด๋ฉ๋ผ์ ์์น๊ฐ ๊ฐ์์ค๋ฝ๊ฒ ๋ฐ๋๋๋ผ๋, ์์ฐ์ค๋ฝ๊ฒ ํ๋ ์ด์ด๋ฅผ ๋ค์ ์ถ์ ํ๋ค.
๊ทธ๋ ๊ธฐ์ ์นด๋ฉ๋ผ ์ง๋ ํจ๊ณผ๋ฅผ ๊ตฌํํ ๋, ์นด๋ฉ๋ผ์ ์์น๋ง ๋ฐ๊ฟ์ฃผ๋ฉด ๋๊ธฐ์ ๊ต์ฅํ ๊ฐํธํ๋ค.
์๋๋ ์นด๋ฉ๋ผ ์์น๋ฅผ ๋ณ๊ฒฝํ์ฌ ์นด๋ฉ๋ผ ์ง๋ ํจ๊ณผ๋ฅผ ์ค ์ฝ๋์ด๋ค.
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.UI;
public class Creep : MonoBehaviour, ILivingEntity, IMonster {
...
// JumpDown
private IEnumerator JumpDown() {
...
// ์นด๋ฉ๋ผ ํ๋ค๋ฆผ ํจ๊ณผ ๋ถ์ฌ
Transform cameraTransform = camera.transform;
Vector3 cameraPosition = cameraTransform.position;
cameraTransform.position = new Vector3(cameraPosition.x, cameraPosition.y + 1.5f, cameraPosition.z);
CoroutineUtility.CallWaitForSeconds(0.25f, () => {
cameraPosition = cameraTransform.position;
cameraTransform.position = new Vector3(cameraPosition.x, cameraPosition.y + 0.75f, cameraPosition.z);
});
...
}
...
}๊ฒ์์ด ์ข
๋ฃ๋ ๋, ์๊ฐ์ด ๋๋ ค์ง๋ ํจ๊ณผ๋ฅผ ์ฃผ๊ณ ์ถ์๋ค.
์๊ฐ์ด ๋๋ ค์ง๋ ํจ๊ณผ๋ฅผ ์ฃผ๊ธฐ ์ํ์ฌ ์๋์ ์ฝ๋๋ฅผ ์์ฑํ์๋ค.
using System;
using System.Collections;
// using UnityEditor.Animations;
using UnityEngine;
using UnityEngine.UI;
using VInspector;
public class RoomSceneManager : Singleton<RoomSceneManager> {
...
private IEnumerator COnPlayerDeath() {
StartCoroutine(CTimeExpansionEffect());
...
}
...
private IEnumerator COnCreepDeath() {
StartCoroutine(CTimeExpansionEffect());
...
}
private IEnumerator CTimeExpansionEffect() {
float timeScaleChangeSpeed = 0.2f;
float differenceTimeScale = Time.timeScale;
float currentTimeScale = Time.timeScale;
while (currentTimeScale > 0.2) {
currentTimeScale -= differenceTimeScale * timeScaleChangeSpeed * Time.unscaledDeltaTime;
Time.timeScale = currentTimeScale;
yield return null;
}
Time.timeScale = 0.2f;
}
}Coroutine์ ์ฌ์ฉํ์ฌ Time.timeScale์ ์์ํ ๋ณ๊ฒฝ์์ผ์ฃผ๋ ๋ฐฉ์์ผ๋ก ์๊ฐ์ด ๋๋ ค์ง๋ ํจ๊ณผ๋ฅผ ๊ตฌํํ์๋ค.