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 /
avatar image
0
Question by MoProductions · Feb 02, 2011 at 02:18 AM · resources

Components for 2D Animation System

Hello there. I'm currently tasked with writing a custom 2D animation system to use in Unity. We're going to use it for things like HUD animations so it'll always be in screen coordinates. The animations will be built out of png frames with each anim having it's own folder. I know how to do most of the work but I had a couple of question with regard to making it a Unity interface editable tool.

1) I want to have the user be able to drag a folder (located somewhere in /Resources) from the Project panel to an Inpsector component in the prefab. I know how to set up public vars in my scripts for things like textures but I'm not sure if there's a way to make the folder location for the frames dragable. This is how the frames for the anim would be defined. Is there a certain type of class I can use to achieve this? I plan on using Resources.LoadAll() to get the array of frames once I know the path.

2) To place an animation on the screen I've got a prefab built starting with an empty GameObject (pos, rot, scale all (0,0,0)) then I added a GUITexture component (pos,rot, scale all at (0,0,0)). The icon for placement is 32x32 so I set the X,Y Pixel Insert both to -16 so that the center of the icon is the center of the animation. When the root GameObject is moved around you get around the screen with X and Y going between 0 - 1.0. This is good for a start but I'm wondering: a) Is there a better way to get an icon on the screen to represent where the animation will be? I can make the texture for the location smaller, but I wanted something that will automatically switch off when the user selects another object in the Hierarchy. Kind of like when the Mesh outline on a 3D object disappears when selecting something else. We're going to have tons of animations for different states but I don't want the screen to get cluttered with their icons on screen all the time. b) Is there a way to let the user define the location in screen coordinates (top->bottom, left->right) in the Inspector? I know that kind of defeats the purpose for multiple screen sizes but I was thinking of having screen size be another variable in the Inspector. Not ideal but we've found it's easier to let the designers think in terms of screen coords rather than screen percentages.

Thank you. Let me know if any of this doesn't make sense. -Mo

Comment
Add comment
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

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Is it possible to download and overwrite a .resx file on mobile? 1 Answer

Loading Resources folder contents in StandAlone Player 1 Answer

Load Custom User Textures from Folder In Desktop Build 0 Answers

Finding ScriptableObject file in GamePlay 3 Answers

Resource.Load is not working 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