반응형

Unity 125

0415_좀비슈터 단계별 테스트 _ 자동발사

해야할것 자동으로 발사가 되는 총을 만들어야한다. (이펙트 연습) - 이펙트가 나와야한다. ----- 0. 건 안에 이펙트 들을 넣어준다 (자식으로 넣어서 같이 움직이게 하려함) 1.AutoShooting를 할 스크립터를 만들어준다. !★ 코루틴 연습 ★! using System.Collections; using System.Collections.Generic; using UnityEngine; public class Shooting : MonoBehaviour { public ParticleSystem eff1; public ParticleSystem eff2; public float cycle = 1f; public void AutoShoot() { StartCoroutine(this.AutoShoo..

0415_좀비슈터 단계별 테스트 _ IK 사용하여 총에 손 달기

테스트를 하기 위해서는 최대한 간략하게 기능만 봐야한다. 새로운 씬 만들기 0. 캐릭터 생성 및 건 피봇, 건 생성하기 1. IK를 사용하려면 먼저 캐릭터에 애니메이터에서 IK를 체크를 해줘야한다,. 틀린방법 { 2. 캐릭터와 총을 새로운 게임오브젝트에 자식으로 넣고 IKTest 스크립터(IK 테스트를 할)를 넣어준다. } 3. 스크립터를 작성하고, 핸들에 손을 붙여준다.. using System.Collections; using System.Collections.Generic; using UnityEngine; public class IKTest : MonoBehaviour { public Animator anim; public Transform leftHandMount; public Transform..

0415_좀비슈터 단계별 테스트 _ RayCast 사용

0. 우먼캐릭터 세팅 및 맵 꺼내오기 1. NavMesh 맵에 만들기 2. App 스크립터 생성 후 레이를 쏘고, 잘 나오는지 확인을 함 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class App : MonoBehaviour { public Transform point; public NavMeshAgent agent; public Zombie zombie; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update..

0413_ Button 누르고 있을 때 슬라이드, 떼었을 때

문제점 기존 코드는 스페이스 키를 누르면 작동하게 만들었다. 하지만, UI에 버튼을 사용하면 이 코드는 쓸 수가 없다. onClick.AddListener 를 쓰려고하면 Update에 넣으면 계속 증가하면서 값이 너무 커지고, 제대로 작동을 하지 않는다. 해결 방법 슬라이드 버튼에 Event Trigger 컴포넌트 넣어서 해결을 하였다. 슬라이드 버튼에 포인터 UP / Down // 눌렀을때 떼었을때, 이벤트를 넣어주고 플레이어(PlayerController가 있는곳 )를 저기에 넣어준다. (★그러면 저 안에있는 스크립터 접근이 가능해진다.) public void OnPointerDown() { this.isSlide = true; this.animator.SetBool("Slide", this.isSl..

0409 _ 레트로의 유니티 게임 예제

레트로의 유니티 게임 프로그래밍 에센스 예제 닷지. 1. using System.Collections; using System.Collections.Generic; using UnityEngine; public class Bullet : MonoBehaviour { public float speed = 16f; private Rigidbody bulletRigibody; // Start is called before the first frame update void Start() { //게임오브젝트에서 리지드바디 컴포넌트를 찾아서 bulletRigibody변수 할당 this.bulletRigibody = GetComponent(); //리지드바디의 속도 = 앞쪽방향 * 이동속령 this.bulletRig..

반응형