중 메모</title>
====== StringBuilder ======
<code csharp>
using System.Text;
private StringBuilder mSbFPS... ializable
2차원 Array를 Inspector에 보여주고 싶을때,
<code csharp>
//[System.Serializable]가 없으면 인스펙터에 보이지 않았다.
[Sys... **firstMenu** 클래스의 **menuName**이 제대로 나온다.
<code csharp>
public class Menu : MonoBehaviour {
[System.Se... 평면 메시에 (스프라이트 용도의) 텍스쳐 입힐때.. 이게 맞나? 잘 모르겠네.
<code csharp>
float _l = 1.0f/texWidth * spriteTopLeft.x;
flo
Pos_ 위치부터 위로 움직인다.
++++ NotifyHandler.cs |
<code csharp>
using UnityEngine;
using System.Collections;
pub... andler.fire()를 호출한다.
++++ UIInputReactor |
<code csharp>
using UnityEngine;
using System.Collections;
pub... =
오브젝트를 따라다니는 라벨
++++ FloatingText2D.cs |
<file csharp FloatingText2D.cs>
using UnityEngine;
using Syste... 에 업데이트 된 코드 있다.
++++ FloatingTextUp2D.cs |
<file csharp FloatingTextUp2D.cs>
using UnityEngine;
using Sys
/books>
</code>
이 xml은 아래 그림처럼 메모리에 구조화 된다.
{{:csharp:xmldom-memorystructure.gif|}}
* 각 원은 XmlNode 개... brary/xe9470fe.aspx|XML DOM(문서 개체 모델) 계층 구조]]
{{:csharp:xmldom-class.gif|XML DOM(문서 개체 모델) 계층 구조}}
이걸 보면... ===== 문서 만들기 =====
읽기/쓰기 어느 쪽을 하든 시작은 이렇게
<code csharp>
XmlDocument doc = new XmlDocument();
</code>
읽으... 한 xml을 LoadXml로 읽어 들인 다음, 값을 수정하는 것도 괜찮겠다.
<code csharp>
using System;
using System.IO;
using System.Xml;
같은 스크립트를 추가
* 패스에 따라 이동시키는 곳에 패쓰 명령어 추가
<code csharp>
using UnityEngine;
using System.Collections;
pu... 가 눈에 보이도록 OnDrawGizmos()에서 그려지는 스크립트를 추가한다. <code csharp>
// 이런 식으로..
void OnDrawGizmos() {
Gizmos.DrawW... _path에 미리 만들어 놓은 빈 오브젝트를 차례대로 추가해서 경로를 완성한다.<code csharp>
public Transform[] _path;
void OnDrawGizmos() { ... ======
랜덤한 회전과, 각 tween 방식을 확인하기 위한 샘플 코드
<code csharp>
public class cubeTexture : MonoBehaviour
{
publi
f }
</code>
==== 플러그인 사용을 위한 C# 스크립트 ====
<code csharp>
using UnityEngine;
using System.Runtime.InteropS... tern "C"%%를 선언해서 name mangling issule를 피할 것
<code csharp>
extern "C" {
float FooPluginFunction ();
}
</c... 이브러릴를 찾는다.
* %%<PluginName>%% : 라이브러리 이름
<code csharp>
[DllImport("<PluginName")]
private static extern... ==== 코드 추가 ====
^ 유니티에 추가하는 플러그인 사용 코드 ^
| <code csharp>
using UnityEngine;
using System.Collections;
pu
보면 관련있는 함수가 있다.
===== GetOutputData =====
<code csharp>void GetOutputData(float[] samples, int channel);... 라면 0, 1 각각 따로 파라미터로 전송해서 2번 함수를 호출해야 한다. |
<code csharp>
// 128kbps 파일이라면, 어디엔가 있는 AudioSource를 얻어 온다 손 치... AudioSource.GetSpectrumData.html|도움말]]을 참조
<code csharp>
// 위 챕터에서 사용한 _musicSource를 그대로 사용
float[] _spec
r에서 상속되는 클래스
* OnInspectorGUI() 오버라이드 함수
<code csharp>
//
// TestClass 에 대한 커스텀 인스펙터를 정의하는 예
//
// 포함... ==
UnityEvent 로 public 변수를 선언하면 알맞게 표시된다.
<code csharp>
using UnityEngine.Events;
public class SampleCla... ;
}
</code>
====== Prefab 생성하는 에디터 ======
<code csharp>
// Create a new prefab for the atlas
Object p