본문 바로가기
728x90

유니티교과서3

[Unity 2D / 유니티 교과서] 6장 예제 ClimbCloud Rigidbody : 중력, 마찰 힘 계산 (강체) -물리 영향을 무시 : Body Type - Kinematic (기본 Dynamic) -회전을 방지 : Constraints - Freeze Rotation z활성 Collider : 충돌 판정 OnTriggerEnter2D(Colider2D) : SceneManager 자주 사용하게 될 Find method -복수형에 주의! 단수형은 처음 찾은 대상을 반환, 복수형은 배열을 반환 FindGameObjectsWithTag(태그이름) FindObjectsOfType(타입이름) using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Scen.. 2023. 2. 1.
[Unity 2D / 유니티 교과서] 5장 예제 PlayerController using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float radius; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.RightArrow)) { this.transform.Translate(3, 0, 0); } else if (Input.GetKeyDown(KeyCode.L.. 2023. 1. 31.
[Unity 2D / 유니티교과서] 3장 예제 Roulette using System.Collections; using System.Collections.Generic; using UnityEngine; public class RouletteController : MonoBehaviour { private float rotSpeed = 0; public float attenuation = 0.96f; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { this.rotSpeed = 10; } //오브젝트를 회전 하는 방법 //회전은 Transform이.. 2023. 1. 30.
728x90