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 Uping · Jul 24, 2014 at 08:09 AM · beginnersystemhowpopuprepeat

how to create a reward system when you level up

okay i have a question and answer game and i want a reward system for it, just like for example after making it to level 10 I want a pop up label that will show that after you cleared level 10 you will get a new skill something like that .

now the problem is I dont want it to appear again if i tried to repeat my level 10 so basically i just want it to pop up on the first time that i played level 10 in my QandA game i hope you get me im not good in english sory

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by DajBuzi · Jul 24, 2014 at 08:22 AM

Hello,

You can do some simple Database of the requirements and rewards table eq. Xml and in the Player object just read and add the id of those Rewards. I think the code will explain it better than me ;)

 public List<Reward> rewards;

 public class Reward {
     public int m_ID;
     public int m_NeededLevel;
     public <SomeRewardType> m_Reward;

     public Reward(){}
 }

 // in the player script
 if(Player.rewards.Where(w => w.m_ID == ID_TO_CHECK).Length != 1)
     Player.rewards.Add(rewards.Where(w => w.m_ID == ID_TO_CHECK));

So now the basic explanation. We have a list of Reward objects and when player reaches certain level we check if he has this RewardID, if he doesnt have we need to add it.

If it's not explained well just post a comment and i'll explain it deeper ;)

Regards, M.Rogalski

Comment
Add comment · Show 1 · 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
avatar image Uping · Jul 24, 2014 at 09:40 AM 0
Share

okay I didnt quite understand because im just a newbie in scripting anyway lets put it this way I want to show a label at the end of the level 10 game after I kill the boss i want a label that shows you unlock a new skill bla bla then after that if I'd like to play again or repeat the level 10 I dont want that message to show again because i already unlock level 11 so i dont need it telling me that i acquire a new skill again

so after i solve this problem or if ever i solve this i already see the next problem the next problem is if i already finish the level 10 and acquire the skill which is just a button if i go back to level 10 i need to have that skill because i already earned it last time i finish the level 10 anyway im not really good at english im really sorry anyway please help me :) thankyou in advance

avatar image
0

Answer by CHPedersen · Jul 24, 2014 at 08:11 AM

In that case, you need to keep track of which awards and skills the user has already collected. I assume you have some kind of object that represents the player? In a script on that GameObject, place a list or other kind of collection that holds the awards and skills collected by that player. When level 10 is cleared, check if the skill it awards is already present in the player's collection. If so, omit popping up the notice.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Checkpoint system??? 3 Answers

Editor black screen. 1 Answer

How to check my Game System Requirements? 2 Answers

Accessing local system ( File Browser ) 2 Answers

Game System requirements other than Stats? 0 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