본문 바로가기

C#17

C# 연산자 § C# 기본 형태 § namespace Basic { class Program { static void Main(string[] args) { } } } § 연산자 § using System; // 산술 연산자 class ClassBasic { static void Main(string[] args) { // 섭씨 화씨 변환기 만들기 int 섭씨 = 12; // 한글변수 사용 가능하다 // 공식 : (섭씨 x 9 / 5 ) + 32 = 화씨 double 화씨 = (섭씨 * (double)9 / 5) + 32; Console.WriteLine("{0}, {1}",화씨, 화씨.GetType()); // 첫 출력 : 53 : 결과값은 더블로 설정했으나, 시작값과 계산값이 모두 int여서 값도 int 출력 /.. 2020. 12. 25.
C# 기초 정리 (정의, 변수) § 기초 § using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace C#_Basic { class Program // class : main함수를 감싸고 있는 공간 // C의 구조체 개념 { static void Main(string[] args) // string : 문자열 | [] : 배열 | args : 매개변수 { System.Console.WriteLine("Hello World"); // Console.WriteLine = printf와 같은 개념 Console.Write("Hello World"); // System.Cons.. 2020. 12. 25.
Input Manager와 Input System Package에 대하여... 1. Unity에서 기본적으로 사용하는 입력 키 및 세팅 설정창. 인풋매니저에서 설정한 값은 실제 코드 및 프로그램에서 외부 입력에 대한 동작을 구현할 때 사용된다. 다만, 단점이 있다면, 처음 해보는 mapping setting이라면, 각 키 또는 축이 어떤식으로 작동되는지, 그리고 어떤 axis 또는 type으로 동작하는지 직접 일일이 찾아내어야 한다는 점이다. 단점이 있다면, 장점도 있기 마련이다. 장점은, 사용하는 유저가 각 키애 대한 매핑값을 알고 있다면, 수월하게 작성할 수 있고, 한 번 세팅된 값을 복사하여, 다른 프로젝트에서도 중복하여 사용할 방법이 있다는 점이다. 복사하고 싶은 프로젝트 내부에서, 인풋매니저 에셋을 원하는 폴더에 옮겨서 적용해주면 된다. 인.. 2020. 12. 23.
Button Click Timer 설정 1. using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class ButtonTimer : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { [SerializeField] float SetTime; float timeremain; Button UIButton; void Start() { UIButton = GetComponent(); timeremain = SetTime; } public void OnPointerEnter(PointerEventData eventData) { InvokeRepeating("countDown", 0, Time.deltaTime.. 2020. 12. 13.