개발 공부 블로그
close
프로필 배경
프로필 로고

개발 공부 블로그

  • 분류 전체보기 (58)
    • CS (18)
      • 언어 공통 (0)
      • C# (7)
      • C++ (11)
      • 디자인패턴 (0)
    • Unity (18)
      • Client (12)
      • Web Server (5)
      • 기술 (1)
    • Unreal Engine (4)
      • Unreal 문서 (3)
      • 이득우의 언리얼 프로그래밍 (1)
    • WEB (1)
    • 프로젝트 (2)
      • 식물대좀비 (2)
    • 코딩 테스트 (5)
      • 백준 (5)
    • 아무거나 (4)
    • 정보처리기사 (4)
  • 홈
  • 태그
  • 방명록

[Unity] OnBeginDrag 안되는 버그(IBeginDragHandler)

* 해결법IDragHandler도 상속받아서 OnDrag() 함수 구현하면 OnBeginDrag도 동작한다! 참고자료https://discussions.unity.com/t/ibegindraghandler-not-called-without-eventtrigger-component/568450/2

  • format_list_bulleted Unity/Client
  • · 2025. 8. 14.
  • textsms

[Unity] Delegate를 사용해 OCP문제 해결하기

문제 상황namespace Delegate{ internal class FileName { public void ShowMenu() { int age = 0; // 전형적인 OCP를 위반하는 코드. // 나라가 추가될 때마다 else if 문이 추가됨. // 참고로 아래 if문 조건은 편의상 간단하게 적은 것임. if ("KOREA") age = GetAge_Korea(); else age = GetAge_Japan(); } private int GetAge_Korea() ..

  • format_list_bulleted Unity/Client
  • · 2025. 4. 16.
  • textsms

[Unity] 빌드하기 전 주의할 점

빌드 후 스크립트에서 불러올 에셋은 Resources 폴더에 있어야 한다.Resources 폴더에서 불러오는 에셋은 Resources.Load로 불러와야한다.(Application.datapath 이런걸로 하면 못 불러옴)

  • format_list_bulleted Unity/Client
  • · 2024. 1. 30.
  • textsms

[Unity] 스크롤뷰가 스크롤이 안 될 때 해결방법

https://javart.tistory.com/74 Scroll View를 생성 후 Content에 Image, Text를 넣고서 Movement Type을 Clamped로 해두었단 것이다. 별로 변인은 아니지만 Content에 Content Size Fitter를 넣고서 " data-og-host="javart.tistory.com" data-og-source-url="https://javart.tistory.com/74" data-og-url="https://javart.tistory.com/74" data-og-image="https://blog.kakaocdn.net/dna/TY0tz/hySYFBwKBM/AAAAAAAAAAAAAAAAAAAAAM26rwHEbUlgnmG_rtr3CbqPRr9hLXvHrzLg2dKhL3tM/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&expires=1782831599&allow_ip=&allow_referer=&signature=k2eC6p25ZGhfrRisiFgYkec0mQ4%3D

  • format_list_bulleted Unity/Client
  • · 2023. 6. 13.
  • textsms
[Unity] Json

[Unity] Json

- 저장할 때(예를 들면 Save & Load를 구현할 때)- 통신할 때- 기타 등등... Json은 코드를 저장하는 택배라고 생각하면 쉽다!저장하기 위해선 코드를 Json으로 변환해 저장하고불러오기 위해선 Json을 가져와 코드로 변환해주면 된다 이때 json과 코드 사이의 변환은 유니티에서 지원해준다! * 저장하기1. 저장할 코드(데이터)를 만든다2. json으로 변환한다 using System.Collections;using System.Collections.Generic;using UnityEngine;class PlayerData{ public string name; public int level; public int coin; public bool skill;}pub..

  • format_list_bulleted Unity/Client
  • · 2023. 5. 18.
  • textsms

[Unity] 좌표계와 함수

1. Local Point : 게임 오브젝트 기준 시점의 좌표2. World Point : 실제 게임오브젝트의 transform.position 값3. Viewport Point : 카메라 내에서 오브젝트가 위치하고 있는 비율(0~1, 0~1)왼쪽아래 : (0,0) 오른쪽 아래: (1,0) 왼쪽 위 : (0,1) 오른쪽 위 : (1,1)4. Screen Point : 카메라 내에서 오브젝트의 위치를 해상도 기준으로 좌표를 매긴 값1920x1080 해상도라면 (0~1920, 0~1080) (pixel 좌표) Local World Viewport Screen 유니티에서 마우스의 좌표는 Input.mousePosition으로 가져올 수 있다.(다만 z성분은 얻을 수 없다.)(z는 카메라와의 거리)하지만 ..

  • format_list_bulleted Unity/Client
  • · 2023. 5. 7.
  • textsms

[Unity] GetComponentsInChildren 검색 범위

한마디로!GetComponentsInChildren는 T유형의 컴포넌트를 가진 오브젝트들의 컴포넌트를 저장한 배열이다. ex)Transform[] seatTransform = GetComponentsInChildren();위와 같이 찾으려는 컴포넌트 타입의 배열이다!! 이 스크립트가 부착된 오브젝트를 대상으로 사용한다면 아래와 같이 사용할 수 있다.myResults = GetComponentsInChildren()또는, 이 스크립트가 부착되지 않은 오브젝트를 대상으로 사용한다면 아래와 같이 사용할 수 있다.myResults = otherComponent.GetComponentsInChildren() 그러면 이 배열에 저장하기 위해 검색하는 범위가 어떻게 되는가?이름이 children뭐시기라 찾으려는 ..

  • format_list_bulleted Unity/Client
  • · 2023. 5. 4.
  • textsms
[Unity] 이미지로 material 만들기

[Unity] 이미지로 material 만들기

1. 새로운 material 생성2. Albedo 왼쪽 네모칸에 준비한 이미지 드래그해서 넣기 or Albedo 왼쪽에 작은 동그라미 아이콘 눌러서 이미지 선택(이미지의 Texture Type은 Sprite(2D and UI))

  • format_list_bulleted Unity/Client
  • · 2023. 4. 11.
  • textsms

[Unity] TextMeshPro 색 변경하기

https://forum.unity.com/threads/accessing-the-text-and-color-of-a-textmeshpro-object.703013/ Accessing the text and color of a textmeshpro objectHello everyone, I am currently trying to change the text and the color of a texmeshpro object. But for some reason I cannot acces it because some...forum.unity.com이 글을 참고함TextMeshPro를 사용했을 때 텍스트의 색을 바꾸고 싶으면transform.GetComponent().color를 이용해서 바꿀 수 있다.그리..

  • format_list_bulleted Unity/Client
  • · 2022. 2. 28.
  • textsms

[Unity] Collider의 속성과 메서드

https://www.youtube.com/watch?v=79b9vFMOi5w&list=PLUZ5gNInsv_PR72-V9bTABaZu2py4DJq8&index=4 위 영상을 바탕으로 작성하였습니다. Is Trigger : 충돌 감지. 물리 효과는 없음. 그러므로 체크하면 충돌은 감지하지만 다른 물체를 통과한다. Material : Physic Material은 물리와 관련된 Material이다.오른쪽마우스 - Create - Physics Material에서 만들 수 있다. Dynamic Friction - 마찰Static Friction - 마찰Bounciness - 탄성Friction Combine - Average면 Friction이 점점 줄어든다.Bounciness Combine - Avera..

  • format_list_bulleted Unity/Client
  • · 2022. 1. 5.
  • textsms

[Unity] Rigidbody의 속성과 메서드

https://www.youtube.com/watch?v=V1ZcL55h3h4&list=PLUZ5gNInsv_PR72-V9bTABaZu2py4DJq8&index=3 위 영상을 바탕으로 작성하였습니다. Edit - Project Settings - Physics Mass : 질량Drag : 공기저항Angular Drag : 회전물체에 대한 저항Use Gravity : 중력Is Kinematic : 체크하면 물리 효과 없어짐Interpolate : 캐릭터의 움직임이 부자연스러울 때 자연스럽게 만들기 위해 쓴다.Collision Detection : 총알같이 빠른 물체 충돌 감지에 쓴다.Freeze Position : 위치 고정Freeze Rotation : 회전 고정 private Rigidbody myR..

  • format_list_bulleted Unity/Client
  • · 2022. 1. 4.
  • textsms

[Unity] Transform의 속성과 메서드/플레이어 이동, 회전, 크기 조절

https://www.youtube.com/watch?v=vfR1vOVNW7U위의 영상을 바탕으로 작성하였습니다. 이동1.void update{ if(Input.GetKey(KeyCode.W)){ // w키를 누르면 this.transform.position = this.transform.position + new Vector3(0,0,1) * Time.deltaTime; // 1초에 z축의 방향으로 1씩 이동한다 }}Time.deltaTime을 쓰는 이유 : 위의 코드에서 만약 deltaTime을 안 쓴다면 1프레임에 1씩 오브젝트가 z축으로 이동할 것이다. 그러면 59프레임인 컴퓨터에서는 1초에 59 이동하고 61프레임인 컴퓨터에서는 1초에 61을 이동하므로 시간에 따른 이..

  • format_list_bulleted Unity/Client
  • · 2022. 1. 3.
  • textsms
  • navigate_before
  • 1
  • navigate_next
공지사항
전체 카테고리
  • 분류 전체보기 (58)
    • CS (18)
      • 언어 공통 (0)
      • C# (7)
      • C++ (11)
      • 디자인패턴 (0)
    • Unity (18)
      • Client (12)
      • Web Server (5)
      • 기술 (1)
    • Unreal Engine (4)
      • Unreal 문서 (3)
      • 이득우의 언리얼 프로그래밍 (1)
    • WEB (1)
    • 프로젝트 (2)
      • 식물대좀비 (2)
    • 코딩 테스트 (5)
      • 백준 (5)
    • 아무거나 (4)
    • 정보처리기사 (4)
최근 글
인기 글
최근 댓글
태그
  • #unity
  • #C#
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바