1.ngui的层与层之间的关系与uiroot所在的层有密切的关系。
2.如果要旋转一个向量,可以用如下方法:
Quaternion currentYawRotation = Quaternion.Euler(0, currentYawRotationAngle, 0);
// Set the position of the camera on the x-z plane to distance meters behind the target
myTransform.position = Transformtarget.position;
myTransform.position -= currentYawRotation * Vector3.forward * distance;
3.c#中 @在路径上,可以直接转义 “\” 。而不使用@,则必须转义 “\” 。
4.c#中的delegate委托是不能直接使用重载的,但是可以使用泛型进行相同的操作:
public delegate void pressButton();
public delegate void pressButton《T》(int num);
IEnumerator playButtonAudio(AudioClip clip, pressButton func)
{
button_source.clip = clip;
button_source.Play();
yield return new WaitForSeconds(0.2f);
func();
}
IEnumerator playButtonAudio(AudioClip clip, pressButton<int> func,int num)
{
button_source.clip = clip;
button_source.Play();
yield return new WaitForSeconds(0.2f);
func(num);
}
5.在用unity的targetimage的时候,模型的mesh要有uv坐标才可以正常的显示出来。
6.unity的模型的层级关系是可以通过3d max 的工具来进行调整的。
7.A coroutine is a function that can suspend its execution (yield) until the given given YieldInstruction finishes.
yield return实际上是在等待后面的条件结束后才会执行yield下面的代码,waitforseconds 执行完毕后实际上也是返回一个YieldInstruction 结构体。