• 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
Question by xaddict · Dec 14, 2009 at 02:42 PM · guitimedatainterface

How to create an agenda or timetable system?

Hello, I know t$$anonymous$$s is a very broad question, but t$$anonymous$$s way I hope to get a lot of answers to choose from. We have a school assignment to create a serious/teac$$anonymous$$ng 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 w$$anonymous$$ch 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 t$$anonymous$$nk t$$anonymous$$s 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 t$$anonymous$$s 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 t$$anonymous$$nk of right now would be:

  • name: name of the assignment
  • fixed_time: whether t$$anonymous$$s is fixed or not (if left empty, it would be an assignment the user can place $$anonymous$$m-/herself).
  • duration: duration of the actual assigment
  • timespan: the timespan in w$$anonymous$$ch 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
duck

People who like this

1 Show 0
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
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 t$$anonymous$$ngs, but as for the code - t$$anonymous$$s sounds like you might be better off creating a Class w$$anonymous$$ch 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 t$$anonymous$$s data in a local or remote database, in w$$anonymous$$ch case it's a whole different question!).

You should probably also create a Timetable class, w$$anonymous$$ch 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 w$$anonymous$$ch ensures they are placed in consecutive cells if that is a requirement.

You should also make sure you're aware of specific custom classes w$$anonymous$$ch 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 w$$anonymous$$ch 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 t$$anonymous$$s. It's a perfect fit for problems of t$$anonymous$$s nature.

Comment
burnumd
BerggreenDK

People who like this

2 Show 0 · 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Airlock Door Code Problems [Solved] 1 Answer

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

Setting Scroll View Width GUILayout 1 Answer

Unity3D Game Time 1 Answer

Convert Timer to HH:MM:SS 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