Unity (20) 썸네일형 리스트형 [Unity] 마우스 클릭 지점으로 이동 [Unity] 마우스 클릭 지점으로 이동 using UnityEngine; public class ClickMove : MonoBehaviour { private Ray ray; private RaycastHit hit; private Vector3 movePos = Vector3.zero; private Transform tr; private Animator anim; // Use this for initialization void Start () { tr = GetComponent(); anim = GetComponent(); } // Update is called once per frame void Update () { ray = Camera.main.ScreenPointToRay(Input.mou.. [Unity] 캐릭터 좌우로 움직이기 (RigidBody) [Unity] 캐릭터 좌우로 움직이기 (RigidBody) [Header("속도 관련 변수")][Range(0,1)] [SerializeField] float moveSpeed; //강제로 인스펙터 창에 띄울 수 있음 Rigidbody myRigid; // Update is called once per frame void Update () { if (Input.GetAxisRaw("Horizontal") != 0) // 왼쪽 -1, 오른쪽 1 { Vector3 moveDir = new Vector3(0, 0, Input.GetAxisRaw("Horizontal")); myRigid.AddForce(moveDir * moveSpeed); } } [Unity] 페이드 인/아웃 (iTween) [Unity] 페이드 인/아웃 (iTween) iTween 사용방법 / Easing 종류 public class CItweenTest : MonoBehaviour { private float _FadeSpeed = 2.0f; public Image _FadeObjWindow; // Use this for initialization void Start () { FadeOutWindow(); } // Update is called once per frame void Update () { } public void FadeOutUpdate(float fAlpha) { Color color; color.r = _FadeObjWindow.color.r; color.g = _FadeObjWindow.color.g; .. [Unity] Changing Ortho Cam Size according to resolution Changing Ortho Cam Size according to resolution Ortho 카메라 크기를 해상도에 맞춰 바꾸기 public class CameraManager : MonoBehaviour { public float horizontalResolution = 1920; void OnGUI () { float currentAspect = (float) Screen.width / (float) Screen.height; Camera.main.orthographicSize = horizontalResolution / currentAspect / 200; } } 이전 1 2 3 다음