Giter VIP home page Giter VIP logo

Comments (3)

stormtek avatar stormtek commented on July 22, 2024

You should be able to add multiple units to the queue for both the WarFactory and the Refinery, and you should be able to specify different types too. The next part I am working on for the tutorial is sound effects, so hopefully that will be added in the next couple of weeks (though no promises as to exactly when that will be).

from unity-rts-demo.

mattsintellectualproperty avatar mattsintellectualproperty commented on July 22, 2024

So to pry it out of you if I can (sorry, this is literally my first stab a C#), to add a second Tank, with exactly the same properties as the first, but to get a second tank to show on the build UI for the Warfactory, what would I need to tweak?

From what I can guess, I would hedge a bet that around line 7 of the WorldObject/Building/WarFactory/WarFactory.cs file would need to include another item for "Tank2"?

from unity-rts-demo.

stormtek avatar stormtek commented on July 22, 2024

Right, let's see if I can write this out clearly. In the Start() method in WarFactory.cs we are defining the actions to be displayed in the sidebar. So to get another build option to display you need to add a new option to this list. But for anything to display (or happen when you click the button that is created) you need to create a Prefab for the new object you want to create (so like the existing Tank prefab). This needs to include a build image (I think that is what it is called) for anything to show in the sidebar. This Prefab then needs to be added to the Units list of GameObjectList (like the current tank is). With those things in place you should be able to create a new Unit from your WarFactory.

Out of curiosity, have you actually worked through the tutorial that this project is part of? Because I am pretty sure that I go over how this process works there.

from unity-rts-demo.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.