유니티
-
04/21 UI json데이터를 읽고 스테이지 정보 출력유니티 2021. 4. 21. 14:42
Json데이터 더보기 { "stageInfos": [ { "stageNo": 1, "state": 0, "stars": 1 }, { "stageNo": 2, "state": 0, "stars": 2 }, { "stageNo": 3, "state": 1, "stars": 0 }, { "stageNo": 4, "state": 2, "stars": 0 }, { "stageNo": 5, "state": 2, "stars": 0 }, { "stageNo": 6, "state": 2, "stars": 0 }, { "stageNo": 7, "state": 2, "stars": 0 }, { "stageNo": 8, "state": 2, "stars": 0 }, { "stageNo": 9, "state": 2, "sta..
-
04/16 수업내용 메모유니티 2021. 4. 16. 18:20
04/16 포스트 프로세싱 후처리 게임화면이 최종 출력되기 전가지 카메라의 이미지를 버퍼에 삽입하는 추가 처리 작은 노력으로 영상미를 구현할 수 있다 ex) 카메라 앱 필터 포스트 프로세싱 연산은 렌더링 파이프라인의 주요 과정의 마지막부분에 적용된다 유니티는 포스트 프로세싱을 쉽게 사용할 수 있는 포스트 프로세싱 스택패키지를 제공한다 렌더링 파이프라인 3차원 이미지를 2차원 래스터 이미지로 표현을 하기위한 단계적인 방법 Main Camera Rendering Path : 랜더링이 처리되는 순서와 방법을 결정하는 옵션 포워드 랜더링 : 각각의 오브젝트를 그릴때마다 해당 오브젝트에 영향을 주는 모든 라이팅을 함게 계산하는 전통적인 방식 메모리 사용량이 적고 저사양에서도 비교적 잘 돌아감 연산속도가 느리고 광..
-
04/15 유니티 애니메이션 컨트롤러 연습유니티 2021. 4. 16. 00:37
1. 캐릭터 모델을 Hierarchy에 2. 애니메이션 컨트롤러 스크립트를 생성하고 캐릭터에 컴포넌트 추가 3. 애니메이션 컨트롤러를 생성하여 캐릭터 모델에 추가 4. 애니메이터에서 blend tree 추가 5. blend tree에 모션 추가 AnimationControllerTest.cs using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class AnimationControllerTest : MonoBehaviour { public float speed; private Animator anim; public Button btnReload; public But..
-
04/15 유니티 LineRenderer 사용 연습유니티 2021. 4. 15. 17:44
LineRendererTest.cs using System.Collections; using System.Collections.Generic; using UnityEngine; public class LineRendererTest : MonoBehaviour { public Transform fireTrans; public float range = 1f; private LineRenderer line; private void Awake() { this.line = this.GetComponent(); } // Start is called before the first frame update public void Shoot() { Debug.Log("shoot"); StartCoroutine(this.Sh..
-
04/15 유니티 화면 클릭으로 이동 구현 연습유니티 2021. 4. 15. 16:47
1. Hierarchy에 캐릭터와 맵 생성 2. window -> AI -> navigation 3. Bake탭에서 Baked Agent Size를 셋팅하고 Bake 4. 스크립트 작성 후 캐릭터에 컴포넌트 추가 5. 컴포넌트에 있는 agent속성에 캐릭터 어사인 새로운 agent Types을 사용하여 진행해 보려고 했으나, 이하의 에러가 발생하여 Humanoid로 진행 "SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.AI.NavMeshAgent:SetDestination (UnityEngine.Vector3) MoveTest:Update () (at Assets/Scri..
-
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..