---
title: "[Unity] 第8讲 塔防1"
author: "gqlu"
date: "2013-07-18T00:22:07Z"
tags: []
categories: ["移动开发"]
slug: "unity-8-1"
draft: false
lastmod: "2013-07-18T00:22:07Z"
id: 1908989
url: "https://gamedev.iteye.com/blog/1908989"
---

这次是看了PushyPixels的第8讲塔防1部分，作者在其中给我们演示了如何建立一个简答的塔防类型游戏，但其中有几点：


地面使用的Plane物体。
怪物的走路点的判断，他使用了rigidbody，但实际上可以直接判断是否接近陆点，用Vector3.Distance()来算。
两个物体能够产生trigger事件，需要不是trigger的那一方有rigidbody组件挂在上面，按照官方的文档说法：
*"Note that trigger events are only sent if one of the colliders also has a rigidbody attached."
*
最后展示一下小的成果：

![](http://dl2.iteye.com/upload/attachment/0087/0901/321e0b56-fa2d-3217-9cb9-a9fe9ab5b2da.jpg)