Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
  • Help Room /
avatar image
0
Question by YoYo89 · Aug 07, 2016 at 01:24 PM · delegatesdaycycleextenddaynight

Extending Hardly Brief Dan's Day and Night Cycle

Hello all,

I've recently been following this great series of tutorials from Hardly Brief Dan (Programming).

In his day and night cycle I'm wondering how to extend it further as I'm new to the use of delegates and their use in this situation, and he never returns to this topic to explain it's implementation further. (Although I'm sure he's shown plenty to extend it to do anything I just can't quite understand how to yet.)

Here's his current setup...

  • TimeManager.cs -> tracks game time and can be referenced to check the time.

  • EventManager.cs -> delegates and their static methods (I'm hazy when looking at this class).

  • Sun.cs -> A use of the EventManager and TimeManager class to rotate a directional light around the x axis based on the time of day.

In his setup, how would you go about adding specific timed events such as 'Hey, it's morning now, play a rooster caw sound' or 'Hey, it's night now play a wolf howl'. Or other similar timed based events like lighting torches at night and extinguishing them at dawn.

Would it be better to write some type of base class like BaseTimedEntity (something similar I wrote for BurgZergs day/night cycle), and just give it a time and a bool and then inherit and override that class to check that bool and do whatever with? How could this be done properly with delegates?

What is the best route to take with his setup? Thanks in advance and sorry for such a long-winded post (and code-dump).

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 Owen-Reynolds · Aug 07, 2016 at 07:46 PM 1
Share

$$anonymous$$oved to HelpRoom, but this sort of long back-and-forth collaboration is more for the forums. Is fine in the HelpRoom, but the people who are interested in working on project might be more likely to see it there.

(The FAQ on the right column here explains regular UA vs. forum, a little.)

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to change day & time in 12hr that moves when pressing a button 0 Answers

How to execute a function after another function has finished its execution? 0 Answers

Counting Days Using In-Game Time System? 1 Answer

When should i be using events 1 Answer

Sun Variable Rotation 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