GithubHelp home page GithubHelp logo

voxelaction's Introduction

๐ŸŽฎ VoxelAction

๐Ÿ“Œ ํ”„๋กœ์ ํŠธ ์†Œ๊ฐœ

๐ŸŽฎ PC 3D ์ŠˆํŒ… ํ”Œ๋žซํผ ๊ฒŒ์ž„์ž…๋‹ˆ๋‹ค.

๐Ÿ“Œ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ

  • Unity3D 2023
  • C#

๐Ÿ“Œ ๊ตฌํ˜„

  • ์—๋””ํ„ฐ์—์„œ ํ™•๋ฅ ์„ ์กฐ์ •ํ•œ ๋Œ€๋กœ ์•„์ดํ…œ์ด ๋žœ๋ค ์ƒ์„ฑ
  • ์˜ค๋ธŒ์ ํŠธ ํ’€๋ง (๋ฉ”๋ชจ๋ฆฌ ํ’€๋ง) ์„ ํ™œ์šฉํ•ด์„œ ํ”Œ๋ ˆ์ด์–ด๋ฅผ ์ซ“์•„์˜ค๋Š” ์ ์ด ์ ์  ๋งŽ์ด ์ƒ์„ฑ๋˜๋„๋ก ํ•˜๊ณ ,
    • SetActive() ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ฃฝ์€ ์ ์„ ์žฌํ™œ์šฉํ•˜์˜€์Šต๋‹ˆ๋‹ค.
    • ํƒ„ํ”ผ ์˜ค๋ธŒ์ ํŠธ, ๊ณต๊ฒฉ ํŒŒํ‹ฐํด์—๋„ ์˜ค๋ธŒ์ ํŠธ ํ’€๋ง์„ ์ ์šฉํ•ด์„œ ๊ฒŒ์ž„์˜ ์„ฑ๋Šฅ์„ ํ–ฅ์ƒ์‹œํ‚ค๊ณ ์ž ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • ์ ์ด ์žฅ์• ๋ฌผ์„ ํ”ผํ•ด์„œ ํ”Œ๋ ˆ์ด์–ด๋ฅผ ์ซ“์•„์˜ค๋Š” ๊ธธ์ฐพ๊ธฐ ๊ธฐ๋Šฅ
    • ํž™ ์ž๋ฃŒ๊ตฌ์กฐ๋ฅผ ์‚ฌ์šฉํ•œ A-Star ์•Œ๊ณ ๋ฆฌ์ฆ˜์œผ๋กœ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๋˜ํ•œ ์ ์˜ ํ–‰๋™์„ FSM์œผ๋กœ ๊ด€๋ฆฌํ•˜์—ฌ ํ”Œ๋ ˆ์ด์–ด์™€์˜ ๊ฑฐ๋ฆฌ์— ๋”ฐ๋ผ ๋ฐฐํšŒ, ์ถ”์ , ๊ณต๊ฒฉ ์ƒํƒœ๋กœ ๋ณ€๊ฒฝ๋˜๋„๋ก ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
    • ๋‹จ์ˆœํžˆ bool ํƒ€์ž… ์ฒดํฌ๋ฅผ ์—ด๊ฑฐํ•˜๋Š” ๋ฐฉ์‹์—์„œ FSM์„ ์ ์šฉํ•ด์„œ ๊ฐ์ฒด์ง€ํ–ฅ์ ์œผ๋กœ ์„ค๊ณ„ํ•˜๋„๋ก ํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ“Œ ๊ตฌํ˜„ ์ƒ์„ธ

  • ํ”Œ๋ ˆ์ด์–ด ์›€์ง์ž„: ๊ฑท๊ธฐ (WASD), ๋‹ฌ๋ฆฌ๊ธฐ (WASD+Shift), ์ ํ”„(Space), ๋”๋ธ”์ ํ”„(Space), ๊ตฌ๋ฅด๊ธฐ(WASD+ Ctrl)
  • ์นด๋ฉ”๋ผ: ๋งˆ์šฐ์Šค ์ž…๋ ฅ์— ๋”ฐ๋ฅธ ํ”Œ๋ ˆ์ด์–ด ์‹œ์•ผ ํšŒ์ „, ์‹œ์  ๋ณ€ํ™˜ 1์ธ์นญ/3์ธ์นญ(V), 1์ธ์นญ์ผ ๋•Œ ์นด๋ฉ”๋ผ์— Culling Mask ์ ์šฉ
  • ๊ณต๊ฒฉ ์ž…๋ ฅ ํ‚ค: 1, 2, 3 ์„ ํƒ ํ›„ ์™ผ์ชฝ๋งˆ์šฐ์Šค๋กœ ๊ณต๊ฒฉ, ์˜ค๋ฅธ์ชฝ ๋งˆ์šฐ์Šค๋ฅผ ๊พน ๋ˆŒ๋Ÿฌ์„œ ์ˆ˜๋ฅ˜ํƒ„ ๋ฐœ์‚ฌ
  • ์žฌ์žฅ์ „: R ํ‚ค
  • ์˜ค๋ธŒ์ ํŠธ ํ’€๋ง (๋ฉ”๋ชจ๋ฆฌ ํ’€๋ง) : ๊ฒŒ์ž„ ์„ฑ๋Šฅ ์ตœ์ ํ™”๋ฅผ ์œ„ํ•ด ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋‚˜์˜ ๋ฉ”๋ชจ๋ฆฌํ’€ ์ธ์Šคํ„ด์Šค๋Š” ํ•˜๋‚˜์˜ ์˜ค๋ธŒ์ ํŠธ๋ฅผ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
    • ๋ชฌ์Šคํ„ฐ ์ž„์˜ ์ƒ์„ฑ
    • ํƒ„ํ”ผ ์˜ค๋ธŒ์ ํŠธ ํ”„๋ฆฌํŒน
    • ์ด๊ธฐ๋กœ ๊ณต๊ฒฉ ์‹œ, ํŒŒํ‹ฐํด ํ”„๋ฆฌํŒน
  • ๋ชฌ์Šคํ„ฐ ์ƒ์„ฑ ์ „ ์ƒ์„ฑ๋  ์œ„์น˜์—์„œ ์ƒ์„ฑ์„ ์˜ˆ๊ณ ํ•ฉ๋‹ˆ๋‹ค.
  • ๋ชฌ์Šคํ„ฐ๋Š” ์ง€์ •๋œ ๋งต์—์„œ ์žฅ์• ๋ฌผ์„ ํ”ผํ•ด์„œ ํƒ€์ผ“(ํ”Œ๋ ˆ์ด์–ด) ์„ ํ–ฅํ•ด ๊ธธ์„ ์ฐพ์•„์˜ต๋‹ˆ๋‹ค. A-Star ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๋ชฌ์Šคํ„ฐ๋Š” ํ”Œ๋ ˆ์ด์–ด์™€์˜ ๊ฑฐ๋ฆฌ์— ๋”ฐ๋ผ์„œ ๋ฐฐํšŒ, ๊ณต๊ฒฉ์„ ํ•  ์ˆ˜ ์žˆ๋„๋ก FSM์„ ์ ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๋ชฌ์Šคํ„ฐ์˜ Collider ์— ๋ถ€๋”ชํžˆ๋ฉด ํ”ผ๊ฒฉ ์ฒ˜๋ฆฌ๊ฐ€ ๋˜์–ด์„œ ํ”Œ๋ ˆ์ด์–ด์˜ ์ฒด๋ ฅ์ด 5์”ฉ ๊ฐ์†Œํ•ฉ๋‹ˆ๋‹ค. ํ™”๋ฉด์ด 0.5์ดˆ๋™์•ˆ Red ์ƒ‰์ƒ์œผ๋กœ ๋ฐ˜์ง์ž…๋‹ˆ๋‹ค.
  • ์ƒํ˜ธ์ž‘์šฉ Eํ‚ค
    • ๋ฌด๊ธฐ ์ˆ˜์ง‘ (OnTriggerStay & OnTriggerExit)
    • ์†Œ๋ชจํ’ˆ ํƒ„์•ฝ, ๋™์ „, ์ฒด๋ ฅ, ์ˆ˜๋ฅ˜ํƒ„ ์ˆ˜์ง‘ (OnTriggerEnter)
  • ๋ฏธ๋‹ˆ๋งต์„ ์นด๋ฉ”๋ผ์˜ ํšŒ์ „ ์ •๋ณด์— ๋”ฐ๋ผ ํšŒ์ „์‹œํ‚ต๋‹ˆ๋‹ค.
  • ์—๋””ํ„ฐ์—์„œ ์ง€์ •ํ•œ ํ™•๋ฅ ์— ๊ทผ์ ‘ํ•˜๋„๋ก ๋žœ๋ค์œผ๋กœ ์†Œ๋ชจํ’ˆ ํ”„๋ฆฌํŒน์„ Instatitate() ๋ฉ”์†Œ๋“œ๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
  • ์ˆ˜๋ฅ˜ํƒ„์„ ์‚ฌ์šฉํ•  ๋•Œ ๋งˆ์šฐ์Šค ์šฐํด๋ฆญ์„ ์ตœ๋Œ€ 3์ดˆ๋™์•ˆ ๊พน ๋ˆ„๋ฅผ ์ˆ˜ ์žˆ๊ณ , ์˜ค๋ž˜ ๋ˆ„๋ฅผ์ˆ˜๋ก ๋” ๋ฉ€๋ฆฌ ๋˜์ ธ์ง‘๋‹ˆ๋‹ค.
  • ์ด ๊ณต๊ฒฉ ๊ตฌํ˜„ : ScreenPointToRay๋ฅผ ํ™œ์šฉํ•ด์„œ 2๋‹จ๊ณ„์˜ RayCast๋ฅผ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.
    • ์ด์„ ์˜๋ฉด ์ž๋™์œผ๋กœ ํ”Œ๋ ˆ์ด์–ด๊ฐ€ ์•ž์„ ๋ฐ”๋ผ๋ณด๋„๋ก ํšŒ์ „์‹œํ‚ค๋„๋ก ShotTurn() ๋ฉ”์†Œ๋“œ๋ฅผ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.
    • 2,3 ํ‚ค ๋ˆŒ๋ €์„ ๋•Œ, ์ด์„ ์ด๋ฏธ ์ˆ˜์ง‘ํ•œ ๊ฒฝ์šฐ์—๋งŒ ์žˆ์„ ๋•Œ์—๋งŒ ์กฐ์ค€ UI (AimPanel) ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“Œ ์˜์ƒ

https://youtu.be/dgtIPAv8868

๐Ÿ“Œ ์‹คํ–‰ ์บก์ณ

image

image

voxelaction's People

Contributors

strurao avatar

Watchers

 avatar

Forkers

codingwatching

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.