본문 바로가기

Unity/C# 언어

LateUpdate 함수 번역 LateUpdate 서술 만약 유니티의 MonoBehaviour가 사용 가능하다면, 상속된 LateUpdate 함수는 모든 프레임에서 호출됩니다. LateUpdate 함수는 스크립트 실행을 지시하기 유용합니다. 예제로 캐릭터를 따라다니는 카메라는 항상 LateUpdate 함수 안에서 수행되어야 합니다. 왜냐하면, Follow Camera는 Update함수 안에서 과거의 상태에서 현재 상태에서 움직였을지도 모르는 오브젝트의 경로를 추적합니다. Description LateUpdate is called every frame, if the Behaviour is enabled. LateUpdate is called after all Update functions have been called. This is .. 더보기
하얀소닉 코드 선언 방식 가이드라인 참조 하얀소닉 코드 선언 방식전역Animator anim; // Animator 유니티에서 지원하는 클래스는 소문자로 선언하는 편이고,float bulletSpeed; // float int 이런 의미들은 헝가리안 표기법을 사용안합니다.Vector3 velocity;int Score;int Coin;bool isJumping; // bool형은 여기서는 점프를 했는가? true : false의 의미를 담은 Is를 씁니다. Is는 대부분 개발자분들이 사용하실 거라 생각합니다. 학원에서는 Is를 붙이라고 배웠습니다.int cooltime_state = 0; // state 따라 보통 mode 이런식으로 쓰는데 예약어 때문에 안될때도 있습니다. 바로 int Mode 이렇게 쓰는것은 선호하지 않습니다.int Musi.. 더보기
generic class serialization Unity3d public class Information{ public string Name; public string NickName; public int birthdate; public UISprite student_image; } 어느 한 스크립트에서 public List studentlist = new List(); 라는 코드를 적어주었다. Generic Class인 List를 UnityEdtior에서 public 화 하고 디버깅을 하지 않고서... 확인하고 싶었으나, 디버깅을 안한다는게 아니라... public 화 하고 싶은데... 답이 없었다. 선생님도 안되는 기능이라 애기하신다. public List studentobj = new List(); 같은 경우는 Transform이라서 Serialize를 안해.. 더보기
Mathf.Sin, Mathf.Cos Mathf.Deg2Rad, 삼각함수 디버깅 using UnityEngine;using System.Collections; public class MathfSinCosPrint : MonoBehaviour { // Use this for initialization void Start () { print("삼각함수"); float sin0 = Mathf.Sin(0 * Mathf.Deg2Rad); print("sin0 = 0 ," + sin0); float sin30 = Mathf.Sin(30 * Mathf.Deg2Rad); print("sin30 = 1/2 ," + sin30); float sin45 = Mathf.Sin(45 * Mathf.Deg2Rad); print("sin45 = 루트2/2 ," + sin45); float sin60 = Mat.. 더보기
pow 제곱 연산 void pow2(){ int i=0;; int num = 1; string a; for(num=1;num 2048) break; } } 더보기