Programing/Unity

    Unity 3D 문 열기/닫기

    Unity 3D 문 열기/닫기

    Unity 3D 문열기/닫기 소스 using System.Collections; using System.Collections.Generic; using UnityEngine; public class DoorScript : MonoBehaviour { public bool open = false; public float doorOpenAngle = 90f; public float doorCloseAngle = 0f; public float smoot = 2f; void Start() { } public void ChangeDoorState() { open = !open; } void Update() { if (open) { Quaternion targetRotation = Quaternion.Euler(0..

    Unity 3D 카메라 줌인/줌아웃

    Unity 3D 카메라 줌인/ 줌아웃 소스코드 using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraZoom : MonoBehaviour { public int zoom = 20; public int normal = 60; public float smooth = 5; private bool isZoomed = false; void Update() { if ( Input.GetMouseButtonDown(1)) // 마우스 오른쪽 버튼으로 줌인/줌아웃 // 키 변경 가능 { isZoomed = !isZoomed; } if(isZoomed) { GetComponent().fieldOfVi..

    유니티 캔버스 스케일러

    유니티 캔버스 스케일러 https://docs.unity3d.com/kr/2017.4/Manual/script-CanvasScaler.html