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 Nov 04, 2014 at 07:33 AM by robertbu for the following reason:

Design/discussion question

avatar image
0
Question by Antowas · Nov 04, 2014 at 07:33 AM · 2dsprite

Swapping sprites after time passes. Animate? Swap? How?

I am working on a 2D top down farming game similar to Harvest Moon (I know. Another one).

I am pretty new to C# and Unity in general. My current issue is that once I figure out how to get my character to plant a crop tile, how do I change the crop tile to show as planted? Do I swap the sprites somehow? Is that done by replacing the sprite with a single frame animation once the condition has been met? Seems to me that would be a waste of processor power. Is there a way to swap the sprites via a C# script?

Anyone who can help out?

Once I have this figured out, I can just set a rate at which the sprite accrues growth and have the sprite change to the next stage of growth until it hits maturity.

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 AlwaysSunny · Nov 04, 2014 at 01:44 AM 0
Share

This open-ended question is best suited to the forums.

You really need a robust custom-built sprite drawing solution for a game with the mechanics you're describing.

You should build your world around a modular tile-based system which encompasses collision (walkability), effects (water tiles create splash particles when entered), and entities. Each tile's uvs should be able to change - based on their type and state - to draw a different part of a sprite atlas.

Plants and other objects should be distinct entities which draw "on top of" the underlying tile. Each entity can have its own script which helps track its state (like plant maturity), and use the same UV-swapping method to pick the appropriate cell of a texture atlas for drawing.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Rotating a sprite distorts it? 0 Answers

Pixel-perfect custom sprite pivot point 2 Answers

SpriteRenderer change order in layer in edit mod via script 1 Answer

Custom 2D armor slots 1 Answer

SetTangentMode of Spline not working through code 1 Answer


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