유니티
-
04/29 유니티 케릭터 컨트롤 + 인풋 R&D유니티 2021. 4. 29. 14:12
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class JoystickTest : MonoBehaviour { public VariableJoystick joystick; public bool isSnap; public Transform heroTrans; public float speed = 1f; public float joypos; public Animation anim; public Button button; // Start is called before the first frame update void Start() { joystick.SnapX =..
-
04/26 유니티 입력값 출력 복습 NGUI, UGUI유니티 2021. 4. 27. 01:58
NGUI를 배우기 시작 복습을 겸하여 NGUI와UGUI로 간단히 Input Field에 값을 입력하고, 버튼을 눌러 디버그 로그로 입력값을 출력하는 씬 제작 개인적 사용 느낌 UGUI를 먼저 배웠기 때문에 UGUI로 구현하는 편이 아직까지는 더 좋은 것 같음 NGUI의 특징 버튼이나 인풋필드같은 클릭이 필요한 것들에는 Collider 컴포넌트를 추가함 UGUI의 Order in Layer를 조절하는 것을 NGUI에서는 Sprite의 Widget의 Depth를 조절 UGUI using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class UGUILogin : MonoB..
-
04/26 유니티 NGUI slider 사용 연습유니티 2021. 4. 26. 17:01
using System.Collections; using System.Collections.Generic; using UnityEngine; public class ButtonTest : MonoBehaviour { public UIButton btn; public UISlider slider; [Range(0f,1f)] public float sliderValue; // Start is called before the first frame update void Start() { this.btn.onClick.Add(new EventDelegate(() => { Debug.Log("button clicked!"); })); StartCoroutine(Check()); } private IEnumerato..
-
04/26 유니티 NGUI 버튼, 입력창 연습유니티 2021. 4. 26. 16:54
Button NGUI는 버튼구현 시 Collider 컴포넌트가 있어야 함 InputField 라벨을 스프라이트에 자식에 두고, 스프라이트에 InputField와 Collider 컴포넌트를 추가 자식에 위치한 라벨을 InputField의 Lavel속성에 어사인 using System.Collections; using System.Collections.Generic; using UnityEngine; public class UISignup : MonoBehaviour { public UIButton btnClose; public UILabel labelEmail; public UILabel labelUserName; public UILabel labelPassword; public UIButton btnSi..
-
04/23 유니티 스크롤 뷰 + 데이터 연동 연습유니티 2021. 4. 23. 18:10
데이터 Resources/Datas0423 사용자디렉토리/AppData/LocalLow/회사이름/프로덕트이름 코드 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.U2D; using UnityEngine.UI; namespace Assets.Scripts.Datas0423 { public class UIListItem : MonoBehaviour { public enum eState { DONE, COMPLETE, DOING } public enum eGauge { FRONT, COMPLETE } public Image img; public SpriteAtlas atlas; pub..
-
-
04/22 UIAnimation R&D유니티 2021. 4. 22. 15:40
UI에 애니메이션을 추가하고 이펙트를 이벤트로 실행 코드 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TestUIAnimation : MonoBehaviour { public Button btn; public Animator anim; public ParticleSystem[] arrEff; // Start is called before the first frame update void Start() { this.anim.GetComponent().onFinished = () => { //플레이 완료시 이펙트 실행 //Debug.LogError("..