유니티
-
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..