전체 글
-
04/15 유니티 IK 연습유니티 2021. 4. 15. 11:41
using System.Collections; using System.Collections.Generic; using UnityEngine; public class IKTest : MonoBehaviour { public Animator anim; public Transform leftHandMount; public Transform rightHandMount; private void OnAnimatorIK(int layerIndex) { // 0..1 범위의 가중치 값을 설정하여 IK가 조준 할 시작 위치와 목표 위치 사이의 거리를 결정합니다. anim.SetIKPositionWeight(AvatarIKGoal.LeftHand, 1); anim.SetIKRotationWeight(AvatarIKGoal..
-
04/14 수업내용 메모유니티 2021. 4. 14. 18:21
2021/04/14 2d 스프라이트 방식 본 방식 본 방식을 많이 사용함 글루벌 일루미네이션 물체의 표면에 직접 들어오는 빛 뿐만아니라 다른 물체의 표면에 반사되어 들어온 간접광 까지 표현하는 것 angular Drag 회전 마찰력 Cinemachine 카메라 관련 패키지 브레인 카메라, 가상 카메라 두개로 구성 데드존, 소프트존, 하드리밋 주시하는 물체가 게임 화면 밖으로 벗어나지 않게 추적의 세기를 단계별로 설정 카메라가 주시하는 물체가 화면의 데드존에 있는동안 카메라가 회전하지 않는다 주시하는 물체가 화면의 소프트존에 있다면 물체가 화면의 조준점에 오도록 카메라가 부드럽게 회전 만약 물체가 너무 빠르게 움직여 화면의 소프트존을 벗어나 하드 리밋에 도달하려 한다면 카메라가 격하게 회전 카메라가 주시 ..
-
04/13 유니티 쿠키런 제작 2유니티 2021. 4. 13. 17:44
체력바 추가 죽는 애니메이션 추가 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class PlayerController : MonoBehaviour { public float jumpForce = 700f; private int jumpCount = 0; private bool isGrounded = false; private bool isDoubleJump = false; private bool isSlide = false; private Rigidbody2D playerRigidbody; priva..
-
04/13 유니티 쿠키런 제작 1유니티 2021. 4. 13. 14:34
배경 이동 캐릭터 점프, 슬라이드 구현 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class PlayerController : MonoBehaviour { public float jumpForce = 700f; private int jumpCount = 0; private bool isGrounded = false; private bool isDoubleJump = false; private bool isSlide = false; private Rigidbody2D playerRigidbody; pr..
-
04/11 유니티 조이스틱으로 캐릭터 이동 연습유니티 2021. 4. 12. 00:41
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class InGame : MonoBehaviour, IPointerDownHandler, IDragHandler, IPointerUpHandler { RectTransform m_rectBack; RectTransform m_rectJoystick; Transform m_trCube; float m_fRadius; float m_fSpeed = 5.0f; float m_fSqr = 0f; Vector3 m_vecMove; Vector2 m_vecNormal; bool m_bTouch = fals..
-
04/09 수업내용 메모유니티 2021. 4. 9. 18:06
04/09 닷지 프로젝트 (Dodge) 템플릿 : 3D 플랫폼 설정 : android 해상도 설정 : 1920x1080 레이아웃 설정 : custom 3D object > Plane 생성 reste transform Scale(2,1,2) Plane 크기는 20유닛 메터리얼 생성 - 쉐이더와 텍스쳐가 합쳐진 에셋 - 오브젝트의 픽셀 컬러를 결정 셰이더 - 주어진 입력에 따라 픽셀의 최종컬러를 결정하는 코드 - 질감과 빛의 의한 반사와 굴절등의 효과를 만듬 메터리얼 생성 Create > Material(Plane Color) Albedo 옆에 Color선택후 검정색으로 설정 Plane에 메터리얼 적용 벽 만들기 Cube생성 (Wall) -> reset transform Cube의 사이즈 1유닛 positi..
-
04/09 유니티 슈팅게임 연습유니티 2021. 4. 9. 15:28
미구현 게임오버 화면 점수 using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public Rigidbody playerRigidbody; public GameObject player; public float speed = 8f; public int hp = 100; public UIController uiController; private Animation animation; private float delta; // Start is called before the first frame update void Start() { an..
-
04/08 유니티 연습유니티 2021. 4. 8. 18:15
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CharacterController : MonoBehaviour { private Animation anim; private Vector3 targetPosition; public EnemyController enemy; private bool isAttack; private bool isRun; private float delta; // Start is called before the first frame update void Start() { this.anim = this.GetComponent(); } public void PlayAni..