unity(51)
-
0405 오브젝트 회전시키기
using UnityEngine; public class RouletteController : MonoBehaviour { float rotSpeed = 0; //회전 속도 // 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.Rotate(0, 0, this.rotSpeed); //if (Input.GetMouseButtonDown(0)) //{ // Debug..
2021.04.05 -
0405 Magnitude 백터의 감산
using UnityEngine; public class Cubecontroller : MonoBehaviour { // Start is called before the first frame update void Start() { Vector3 endPos = new Vector3(11, 0, 9); Vector3 currentPos = this.transform.position; //3,0,4 var dir = endPos - currentPos; var len = dir.magnitude; Debug.LogFormat("len: {0}", len); var distasnce = Vector3.Distance(endPos, currentPos); Debug.LogFormat("distance: {0}"..
2021.04.05 -
0405 기본
scene 뷰 안에 있는 모든 물체는 game object이다. 동시에 hierachy에 표시된다 progject 창에 있는 모든 것은 파일이다 게임 오브젝트는 컴포넌트로 이루어져 있다 컴포넌트들은 탈부착 가능, 단 transform은 제외 1. 플랫폼설정 2. 게임뷰 해상도 설정 3. 카메라 설정 clear flags : solid color , background : 어둡게 2d - 직교설정, size설정 3d - x 4. SceneView에서 toggle skybox
2021.04.05