UNITY MEMO

935 단어 Unitytech
- 기본 함수
void Update(){}
{}内に記述した処理を毎フレーム更新時に呼び出す
void FixedUpdate(){}
{}内に記述した処理を物理演算でキャラクターが動く度に呼び出す
- 인덱스에서 숨기기
[System.Serializable]
- 다른 파일의 클래스를 호출하여 생성
//sample.cs
 public class testClass{
 }
//*.cs
var data = new sample.testClass();
- 최소값 최대값 검사
最小値0 最大値99999
Mathf.Min(Mathf.Max(0, 変数), 99999);
- 초기값에서 애니메이션 재생
Animator _animator = GetComponent<Animator>();
var _info = _animator.GetCurrentAnimatorStateInfo(0);
_animator.Play(_info.fullPathHash, 0, 0.0f);
- 사운드가 끝날 때 함수 실행하기
AudioSource audio = GetComponent<AudioSource>();
float audioTime = audio.clip.length;
Invoke("関数名", audioTime);

좋은 웹페이지 즐겨찾기