Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jul 30, 2012 at 12:58 AM by Eric5h5 for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by darbotron · Jul 29, 2012 at 10:44 PM · sampleangry botsbest practice

Angry Bots sample: best practice?

I've just been digging about in the Angry Bots sample project.

Somehow I eneded up mooching about in the scripts attached to one of the big ED-209 style mechs and I noticed a script called 'FootStepHandler.js', had a look in there and got confused...

There's a function called OnFootstep() in this script and something must be calling it, but what? I'd got no idea where to look to find out how it might be getting called.

I triend find in files in Visual Studio. No joy, but was I looking in the right place? I tried file type . in the whole project folder. Still no joy.

In the end I just started trawling through all the scripts attached to the mech, and eventually found a property called 'Footstep Signals' on a script called 'MechAnimation.js' on a sub-object in the mech's gameobject hierarchy.

Opening the hierarchy of the Footstep Signals property eventually unearthed a property of a sub-part of that property (!) called 'Action' that was called 'OnFootstep'.

A quick look at the code in the script and, yep that seemed to be what was calling the script. Seriously?

Surely this sample has already formed the basis for innumerable first forays into making games and so it should be showing best practice?

Consistent structure, organisation of assets and code, some sort of showcase for whatever might stand in for coding standards in Unity terms, or at the very least some comments explaining how on earth this scattered bunch of event driven scripts hang together to make a game?

Now whilst it is awesome that Unity affords this kind of freedom and expressivity through its data driven architecture; there must be a saner way to organise this sort of code / data / code inter-reliance?

An even if there isn't; given that the (assumed to be) 'best practice' sample project uses code that implicity relies on property values set up in other code - and also some sort of mechanism whereby the gameobject can call a function in any script attached to it - is there any reason that there isn't a search tool that allows the hierarchy and project to be searched for strings to aid in finding these sorts of code-is-data-to-code dependencies more easily?

To be honest, a sensible comment in HandleFootsteps.js would probably have made a billion% difference in how easy it was to track down.

So I guess my final question is, is Angry Bots meant to be a 'best practice' sample, and if not is ther a 'Unity Best Practices' document / showcase project somewhere?

Cheers,

Alex

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Jul 30, 2012 at 12:58 AM 1
Share

This is really a discussion question that would be suitable for the forums, since it's not a specific development question that has an objective answer.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

FPS Sample Unity 2 Answers

How can I pre-load samples from an audio file to spawn objects? 1 Answer

Angry Bots doesn't open the End Sequence 0 Answers

Handling mouse input based on situation 0 Answers

Sample for card matching/memory game? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges