Skip to content
DSelonPublic

About

Unity graduation work game project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

ย 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Infection

ํ”„๋กœ์ ํŠธ ๊ฐœ์š”

์กธ์—… ์ž‘ํ’ˆ์œผ๋กœ ์ œ์ถœํ•œ ์œ ๋‹ˆํ‹ฐ ๊ฒŒ์ž„ ๊ฐœ๋ฐœ ํ”„๋กœ์ ํŠธ


๊ฐœ๋ฐœ ๊ธฐ๊ฐ„

2024.9. ~ 2024.11. (3๊ฐœ์›”)


์—ญํ•  ๋ถ„๋‹ด

์ด๋ฆ„ ์—ญํ• 
๊ณ ์„ฑํ˜„ ๊ธฐํš+๊ฐœ๋ฐœ
๊น€์˜ˆํ˜„ ์บ๋ฆญํ„ฐ 3D ๋ชจ๋ธ๋ง
์ •ํ˜„์ˆ˜ ๋ฐฐ๊ฒฝ 3D ๋ชจ๋ธ๋ง

์ ์šฉ๋œ ๊ธฐ์ˆ 

Unity | C#


์ž‘๋™ ์˜์ƒ

https://blog.naver.com/cgko321/223679401063


ํ”„๋กœ์ ํŠธ ์„ธํŒ… ๋ฐฉ๋ฒ•

๊ณผ์ •

  1. Unity 2022.3.44f1 ๋ฒ„์ „์˜ ์œ ๋‹ˆํ‹ฐ๋ฅผ ์„ค์น˜ํ•œ๋‹ค.
  2. ํ•ด๋‹น ํ”„๋กœ์ ํŠธ๋ฅผ ์ปดํ“จํ„ฐ๋กœ ๋‚ด๋ ค๋ฐ›๋Š”๋‹ค.
  3. ํ”„๋กœ์ ํŠธ๋ฅผ ์—ด๊ณ , ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €์—์„œ ์•„๋ž˜์˜ ์—์…‹๋“ค์„ ์ž„ํฌํŠธํ•œ๋‹ค.

ํ•„์š” ์—์…‹ ๋ชฉ๋ก

  • 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 ์‹ค์ œ๋กœ ํ”Œ๋ ˆ์ด๊ฐ€ ์ง„ํ–‰๋˜๋Š” ํ™”๋ฉด

๊ฐ์ฒด ๊ตฌ์กฐ

Block

๋งต์— ๋ฐฐ์น˜๋˜์–ด ํŠน์ • ๊ธฐ๋Šฅ์„ ์‹คํ–‰ํ•˜๋Š” ํด๋ž˜์Šค ๋ชจ์Œ

ํด๋ž˜์Šค ์šฉ๋„
Spawner \ ... ์†Œํ™˜ ํด๋ž˜์Šค ๋ชจ์Œ
Spawner \ MonsterSpawner ๋ชฌ์Šคํ„ฐ ์†Œํ™˜ ํด๋ž˜์Šค
System \ ... ์‹œ์Šคํ…œ ํด๋ž˜์Šค ๋ชจ์Œ
System \ WaveSystem ์›จ์ด๋ธŒ ์‹œ์Šคํ…œ ํด๋ž˜์Šค
Camera

์นด๋ฉ”๋ผ ํด๋ž˜์Šค ๋ชจ์Œ

ํด๋ž˜์Šค ์šฉ๋„
CameraRatio ํ™”๋ฉด ๋น„์œจ ์ž๋™ ์กฐ์ • ํด๋ž˜์Šค
MainSceneCameraMovement ๋ฉ”์ธ ์”ฌ ์นด๋ฉ”๋ผ ์›€์ง์ž„ ํด๋ž˜์Šค
Entity

ํ”Œ๋ ˆ์ด์–ด/๋ชฌ์Šคํ„ฐ ๋“ฑ ๊ฐœ์ฒด ํด๋ž˜์Šค ๋ชจ์Œ

ํด๋ž˜์Šค ์šฉ๋„
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 ํ”Œ๋ ˆ์ด์–ด ์ด๋™ ํด๋ž˜์Šค
Manager

์”ฌ ๋ณ„๋กœ ํ•˜๋‚˜๋งŒ ์กด์žฌํ•˜๋Š” ๊ด€๋ฆฌ ํด๋ž˜์Šค ๋ชจ์Œ

ํด๋ž˜์Šค ์šฉ๋„
MainSceneManager ๋ฉ”์ธ ์”ฌ ๊ด€๋ฆฌ ํด๋ž˜์Šค
RoomSceneManager ๋ฃธ ์”ฌ ๊ด€๋ฆฌ ํด๋ž˜์Šค
TitleSceneManager ํƒ€์ดํ‹€ ์”ฌ ๊ด€๋ฆฌ ํด๋ž˜์Šค
Other

๋””์ž์ธ ํŒจํ„ด ์ฝ”๋“œ๊ฐ™์€ ๊ธฐํƒ€ ํด๋ž˜์Šค ๋ชจ์Œ

ํด๋ž˜์Šค ์šฉ๋„
Singleton ์‹ฑ๊ธ€ํ†ค ํŒจํ„ด ๊ตฌ์กฐ ์ƒ์„ฑ ํด๋ž˜์Šค
Utility

์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” ๊ธฐ๋Šฅ๋“ค์„ ํ•จ์ˆ˜๋กœ ๋ฌถ์€ ํด๋ž˜์Šค ๋ชจ์Œ

ํด๋ž˜์Šค ์šฉ๋„
AnimationUtility ์• ๋‹ˆ๋ฉ”์ด์…˜ ๊ธฐ๋Šฅ ํด๋ž˜์Šค
BGMUtility BGM ๊ธฐ๋Šฅ ํด๋ž˜์Šค
CoroutineUtility ์ฝ”๋ฃจํ‹ด ๊ธฐ๋Šฅ ํด๋ž˜์Šค
DisplayUtility ํ™”๋ฉด ๊ธฐ๋Šฅ ํด๋ž˜์Šค
LoadUtility ๋กœ๋”ฉ ๊ธฐ๋Šฅ ํด๋ž˜์Šค

ํ•ต์‹ฌ ๊ธฐ๋Šฅ

Singleton ํŒจํ„ด ํ™œ์šฉ

Singleton.cs
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๊ตฌ์—ญ์œผ๋กœ ๋‚˜๋ˆ„์–ด์„œ ๊ตฌํ˜„ํ•˜์˜€๊ธฐ์—,
๋Šฅ๋ ฅ๋ณ„๋กœ ์• ๋‹ˆ๋ฉ”์ด์…˜/ํšจ๊ณผ์Œ/ํšจ๊ณผ/ํšจ๊ณผ ๊ธฐ๋Šฅ์ด ๋‹ค๋ฅด๋”๋ผ๋„ ๋Œ€์‘ํ•˜์—ฌ ๊ฐœ๋ฐœํ•  ์ˆ˜ ์žˆ๋‹ค.

์นด๋ฉ”๋ผ ์ง„๋™ ํšจ๊ณผ

์นด๋ฉ”๋ผ๊ฐ€ ํ”Œ๋ ˆ์ด์–ด๋ฅผ ์ถ”์ ํ•  ์ˆ˜ ์žˆ๋„๋ก ์•„๋ž˜์™€ ๊ฐ™์ด ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜์˜€๋‹ค.

PlayerMovement.cs
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()๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์นด๋ฉ”๋ผ๊ฐ€ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ํ”Œ๋ ˆ์ด์–ด๋ฅผ ๋”ฐ๋ผ๊ฐ€๋„๋ก ๊ตฌํ˜„ํ•˜์˜€๋‹ค.
์นด๋ฉ”๋ผ์˜ ์œ„์น˜๊ฐ€ ๊ฐ‘์ž‘์Šค๋Ÿฝ๊ฒŒ ๋ฐ”๋€Œ๋”๋ผ๋„, ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ํ”Œ๋ ˆ์ด์–ด๋ฅผ ๋‹ค์‹œ ์ถ”์ ํ•œ๋‹ค.
๊ทธ๋ ‡๊ธฐ์— ์นด๋ฉ”๋ผ ์ง„๋™ ํšจ๊ณผ๋ฅผ ๊ตฌํ˜„ํ•  ๋•Œ, ์นด๋ฉ”๋ผ์˜ ์œ„์น˜๋งŒ ๋ฐ”๊ฟ”์ฃผ๋ฉด ๋˜๊ธฐ์— ๊ต‰์žฅํžˆ ๊ฐ„ํŽธํ•˜๋‹ค.
์•„๋ž˜๋Š” ์นด๋ฉ”๋ผ ์œ„์น˜๋ฅผ ๋ณ€๊ฒฝํ•˜์—ฌ ์นด๋ฉ”๋ผ ์ง„๋™ ํšจ๊ณผ๋ฅผ ์ค€ ์ฝ”๋“œ์ด๋‹ค.

Creep.cs
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);
        });

        ...

    }

    ...

}

๊ฒŒ์ž„ ์ข…๋ฃŒ ํšจ๊ณผ

๊ฒŒ์ž„์ด ์ข…๋ฃŒ๋  ๋•Œ, ์‹œ๊ฐ„์ด ๋А๋ ค์ง€๋Š” ํšจ๊ณผ๋ฅผ ์ฃผ๊ณ  ์‹ถ์—ˆ๋‹ค.
์‹œ๊ฐ„์ด ๋А๋ ค์ง€๋Š” ํšจ๊ณผ๋ฅผ ์ฃผ๊ธฐ ์œ„ํ•˜์—ฌ ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜์˜€๋‹ค.

RoomSceneManager.cs
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์„ ์„œ์„œํžˆ ๋ณ€๊ฒฝ์‹œ์ผœ์ฃผ๋Š” ๋ฐฉ์‹์œผ๋กœ ์‹œ๊ฐ„์ด ๋А๋ ค์ง€๋Š” ํšจ๊ณผ๋ฅผ ๊ตฌํ˜„ํ•˜์˜€๋‹ค.

About

Unity graduation work game project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages