Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
1
Question by xaddict · Dec 14, 2009 at 02:42 PM · guitimedatainterface

How to create an agenda or timetable system?

Hello, I know this is a very broad question, but this way I hope to get a lot of answers to choose from. We have a school assignment to create a serious/teaching game. We would like an agenda to be incorporated. Important are:

  • the current time (from 0:00am to 12:00 pm, or from 0:00 to 24:00 in European measures, likely the last)
  • a lot of assignments can be dynamically placed in time slots (any time... even minutes, maybe snapped to 15min intervals)
  • the system keeps track of every assignment placed and checks whether it's done.
  • assignments have a timespan in which the user COULD do them. So one assignment could take 15min but has a two hours-bar on the visual agenda, to give the user a choice when he wants to do it.
  • if the time of an assignment has passed and it's not done the assignment is set to that status.

I think this system could work by using an array, with all assignments in key-value pairs with all data in them, that gets checked every second (or two, or max. five) But I have no clue as where to start about this in Unity.

If anyone has any good ideas to help us get started or knows a way to simplify the process, please let know...

possible key-values I can think of right now would be:

  • name: name of the assignment
  • fixed_time: whether this is fixed or not (if left empty, it would be an assignment the user can place him-/herself).
  • duration: duration of the actual assigment
  • timespan: the timespan in which the assigment could be done
  • status: 0 for inactive, 1 for active, 2 for passed, 3 for failed

Cheers, and thanks to everyone who's willing to help.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Wiki

Answer by duck · Dec 14, 2009 at 05:32 PM

I'm not going to be too much help with the GUI side of things, but as for the code - this sounds like you might be better off creating a Class which represents an assignment. You would then give your class these variables or properties, and add instances of your class to the timetable (unless you're wanting to store this data in a local or remote database, in which case it's a whole different question!).

You should probably also create a Timetable class, which is responsible for containing and modifying the data stored inside. If your system sticks strictly to the 'quantised' 15-minute slot system, you might have an array inside the timetable class, where each discrete cell in the array represents a 15 minute chunk of time. You could then place instances of each assignment object into these cells. An assignment could be placed into more than one cell, and you could add code which ensures they are placed in consecutive cells if that is a requirement.

You should also make sure you're aware of specific custom classes which are designed to store the type of data you're using. Such as DateTime and TimeSpan, and Enums for items like your 'status' variable.

You might be interested in reading an article I wrote which describes the differences between some of the many types of collection available to you in Unity (and Mono in general):

Unity Coding: Arrays, Hashtables and Dictionaries explained

Also, I strongly recommend you consider using the MVC pattern ("Model, View, Controller") to implement this. It's a perfect fit for problems of this nature.

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

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

Unity3D Game Time 1 Answer

Convert Timer to HH:MM:SS 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Airlock Door Code Problems [Solved] 1 Answer

Setting Scroll View Width GUILayout 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