전체 글

전체 글

    [유니티C#][기초] 11. 적에게 체력 부여하기

    1234567891011121314151617181920212223242526272829303132using System.Collections;using System.Collections.Generic;using UnityEngine; public class EnemyHealth : MonoBehaviour{ public int maxHealth = 100; public int currentHealth; private ParticleSystem hitParticle; public void Awake() { currentHealth = maxHealth; hitParticle = GetComponentInChildren(); } public void TakeDamage(int damage, Vector3 ..

    [유니티C#][기초] 10.플레이어 슈팅 5 (최종)

    12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816..

    [유니티C#][기초] 9. 플레이어 슈팅 4

    1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 using System.Collections;using System.Collections.Generic;using UnityEngine; public class PlayerShooting4 : MonoBehaviour{ public Transform gunBarrelEnd; private LineRenderer gunLine; private Light gunLight; public float power = 10000f; pub..

    [유니티C#][기초] 8. 플레이어를 따라오는 적 만들기

    https://www.youtube.com/watch?v=rvuwDBJK83o&t=5s 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class EnemyMovement : MonoBehaviour { private Transform target; private NavMeshAgent navAgent; public void Awake() { target = GameObject.FindGameObjectWithTag("Player").transform; n..

    [유니티C#][기초] 7. 플레이어 슈팅 3

    1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 using System.Collections;using UnityEngine; public class PlayerShooting3 : MonoBehaviour{ public Transform gunBarrelEnd; private LineRenderer gunLine; private Light gunLight; public float power = 10000f; public float range = 100f; public float ti..

    [유니티C#][기초] 6.플레이어 슈팅 2

    12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 using System.Collections;using System.Collections.Generic;using UnityEngine; public class PlayerShooting2 : MonoBehaviour{ public Transform gunBarrelEnd; private LineRenderer gunLine; public float power = 10000f; public float range = 100f; public float timeBet..

    [유니티 C#][기초] 5.플레이어 슈팅 1

    12345678910111213141516171819202122232425262728293031323334353637383940using System.Collections;using System.Collections.Generic;using UnityEngine; public class PlayerShooting : MonoBehaviour{ public Transform gunBarrelEnd; private LineRenderer gunLine; public float range = 100f; private Ray ray = new Ray(); private RaycastHit hit; public void Awake() { //자식에게 있는 컴포넌트를 가져온다. gunLine = GetCompone..

    [유니티 C#][기초] 4. 마우스, 키보드 입력 받기

    12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758using System.Collections;using System.Collections.Generic;using UnityEngine; public class PlayerControler2 : MonoBehaviour{ public float speed = 15f;//캐릭터 이동속도 private Rigidbody rb; private int floorLayerMask;//마우스 레이케스트에 필요한 레이어 private const float maxDistance = 1000f;// 레이캐스트 최대거리 public ..