RUVIDEO
Поделитесь видео 🙏

Unity RTS Tutorial - Resource Object смотреть онлайн

ACCESS the FULL COURSE here: https://academy.zenva.com/product/strategy-game-development-academy/?zva_src=youtube-strategy-academy

TRANSCRIPT

Hey everyone, and welcome back. In this lesson we're gonna work on starting to create our resource, which is gonna be a tree that the units can then gather and which gives them food, and with this food, they can then spawn more units. So to begin, I'm gonna create a new empty game object. I'm gonna call this one here our Resource_Tree. And I'm gonna set it to zero, zero, zero position so that we can get it in the center of the screen for now. Now with this resource tree, if we go on the scene view and press F to focus on it, there's nothing there right now. So, let's actually go to our Models folder and drag in the tree as a child of the empty object. Let's bring the tree to the center. As you can see, it is very large. We probably don't want it that large. So, I'm gonna bring the scale down here to maybe 0.12 as that looks fairly to scale. And if we go to the game view here, we can see that the tree is in view, and it looks fairly decent size. So now what we can do is go back to our Resource_Tree object here and let's start off by changing the tag to resource and the layer to resource as well. If this here pops up we can just click no, this object only. And now we can begin with the components. Now with our resource, we are gonna have a script, which manages the quantity of food that is in it, the type of resource, and whenever a unit wants to get that resource, it will go for this script, so you can check okay, do I have enough of this to give away? If so, give it. If not, give what I have left and then destroy the resource. So in our Scripts folder, I'm gonna create a new C# script here called ResourceSource. Go to our Resource_Tree here and I'm gonna drag and drop that script on. Let's also add in another script. And this is gonna be our resource UI because with this tree, we're gonna have it so that if we hover over the tree, then a little window is gonna pop up that shows us basically the quantity of food left in this resource. So, let's create a new tree. This is gonna be called our ResourceSourceUI. We can then select our Resource_Tree and attach that as well. So, we have these two scripts on right now. And we need to add two more components. The first is a capsule collider, and this is going to be here to detect our mouse clicks 'cause we're gonna have enemy selected or we're gonna have units selected. And then we're gonna be right-clicking on this tree, so we need a collider for that to be detected. For this capsule collider, I'm gonna set the radius here to about one, a height of four, and let's bring this Y center up to about two so it's, so the capsule sits around there. Along with this capsule collider, we also want to add in a navmesh obstacle. In the previous course, we did work on setting up a navmesh, which, if we go to the navigation panel right here, you can find that by going Window, AI, Navigation. It has basically a blue plane for the surfaces that the units can walk on. Now, with this tree here, we could select this tree, and then go to where it says object, and then we'll select the model, then go navigation static, not walkable. But the problem with that is, when these trees then eventually get destroyed once the resource is over, then there will still be a gap here in the navmesh where that tree once was. Because these navmeshes, by default when you bake them, they're not dynamic, as the name entails they're baked, So they're baked into the actual mesh. So a way we can get around this by making this a dynamic object, is by adding a component called a navmesh obstacle. So, navmesh obstacle right here, we want to make it a capsule shape, let's set the center here to zero, zero, radius of, we can set that to 1.3, and we can have a height of 4. Now if we go to navigation, you'll see that nothing's happening. And the reason why is because we need to set this navmesh obstacle to carve, which will then carve into the existing navmesh. So if we go back to the navigation panel now, you'll see that this navmesh now has a big gap in it, where this tree is. And if we actually move this tree around you'll see that that gap also follows along.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Unity RTS Tutorial - Resource Object» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.