文章分类 - Unity3D
摘要:1. minimap camera depth > main camera. so first render main camera ,then render minimapcamera ,chang viewport rect can see the result.2. add rendertex...
阅读全文
posted @ 2014-10-13 07:12
penney
摘要:funciont can't find reference but is working , so like checkbox functionname, 2. add event. 3. invoke every time.
阅读全文
posted @ 2014-10-10 13:20
penney
摘要:1. 避免使用str+=“dddd” 。 string每次赋值,就是重新的分配内存。 如果要多次+字符串,采用stringbuilder。2.使用索引 a[i] 而不是 a0 = a[0] .3. 多使用struct 等数据结构,因为他是分配连续的内存,便于管理。http://en.wikipedi...
阅读全文
posted @ 2014-08-14 09:33
penney
摘要:一个sprite 对应一个 polygon collider 。 先修改spritrender sprite ,再添加polygon collider2D 。 disabled 所有polygon collider 。然后再相应的动画事件中,设置相应的polygon collider enable
阅读全文
posted @ 2014-07-23 01:36
penney
摘要:A normal to a surface at a point is the same as a normal to the tangent plane to that surface at that point.
阅读全文
posted @ 2014-07-18 16:25
penney
摘要:Apply root motion is checked, 整个骨骼都会在场景中改变位置。 not checked,骨骼只会相对的移动(就像在跑步机上)不会改变在场景重的位置。public class AnimatorTest : MonoBehaviour { // Use this for in...
阅读全文
posted @ 2014-07-16 16:11
penney
摘要:如果在游戏中需要大量的创建和销毁物体,那么最好是引入对象池。一下是一个简单的例子:创建一个对象bullet把bullletDestroy Bullet添加到Bullet对象上。生成一个bullet的prefab。public class BulletUpdate : MonoBehaviour { ...
阅读全文
posted @ 2014-07-13 10:36
penney
摘要:预制体是个母体,方便大量繁殖,方便全军修改 -----摘自网友(美术_夹块布BJ)。
阅读全文
posted @ 2014-07-11 14:34
penney
摘要:1.相同点都是要在每一帧内调用2.不同点update每次调用的时间间隔不一样,fixedupdate每次调用的时间间隔都一样。update的调用适合如下的情况:对于非物理作用的物体的控制,对input的检测,还有simple timer (定时 displaying a timer)。fixedup...
阅读全文
posted @ 2014-07-11 12:08
penney
摘要:void Update () { if (Input.GetKeyDown(KeyCode.P)) { isForce = true; print("i have "+(isForce?"yes":"No")+" Force ");// ...
阅读全文
posted @ 2014-07-09 16:17
penney
摘要:关键代码如下 void TileBackgroundImages() { var currentpositon = cameraReference.position.x;// var currentpositon = testcube.position.x; ...
阅读全文
posted @ 2014-07-06 17:03
penney
摘要:// Update is called once per frame void Update () { var move = Time.deltaTime * speed; if (isVertical) { transform.Translate(Vecto...
阅读全文
posted @ 2014-07-05 14:23
penney
摘要:if i nested startcoroutine like the folloing code: IEnumerator ParallaxOffset() {// yield return new WaitForSeconds(0.3f); var offse...
阅读全文
posted @ 2014-07-05 13:47
penney
摘要:在迭代器中使用while 导致ide挂起。比如IEnumerator Test() { yield return new WaitForSeconds(2); Debug.Log("return null"); Start...
阅读全文
posted @ 2014-07-03 23:32
penney
摘要:void MoveFunc() { var currentposition = transformself.position; if (Input.GetButtonDown("Fire1")) { var mousetarge...
阅读全文
posted @ 2014-07-03 18:21
penney
摘要:需要设置预编译比如#if DEBUG ,在visual studio 中,开发微软的项目,已经内置了这个预编译,但是untiy不一样,方法1:可以在每个文件第一行设置#define DEBUG方法2:可以设置全局的预编译edit--〉project setting--〉player方法3:visau...
阅读全文
posted @ 2014-07-03 18:11
penney
摘要:the rending sequence is from top to bottom.like, first rend layer0 --->layer1--->layer2---->layer3.so the background will be rendered behide.
阅读全文
posted @ 2014-07-03 18:07
penney
摘要:IEnumerator Start () { yield return new WaitForSeconds(2); this.GoBall(); Debug.Log("Begin to go ball"); }必须是IEnumerator 返...
阅读全文
posted @ 2014-06-19 11:01
penney
摘要:In our above example, we callVector3.Lerp()like this:transform.position=Vector3.Lerp(_startPosition,_endPosition,percentageComplete); // 可以是时间的分数,也可以是...
阅读全文
posted @ 2014-06-16 17:12
penney

浙公网安备 33010602011771号