Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Drymarti111

Score on click button

Question

Hey everyone!

 

I'm making a quiz application and I've got a problem.

 

I don't know how to make script like:

 

add +1 to score when

click on texture(or object, but i prefer texture button).

 

You know what I mean? 

 

 

If i click on texture, that give me +1 to score,

score up the screen.

 

Can help me someone?

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts


  • 0

A quick script with an area for 2 buttons with textures, shows a score underneath and checks if they are correct or not

Please login or register to see this spoiler.

Share this post


Link to post
Share on other sites
  • 0

Thank You, this script is very good, but I have ready system, only what i need (if it is possible) is simple "score show" and little code what I can paste to my code to texture.

 

I have script on texture: 

#pragma strict
var playNormal : Texture2D;
var playHover : Texture2D;
 
 
 
function Start () {
 
}
 
function OnMouseEnter () {
 
guiTexture.texture = playHover;
 
}
 
function OnMouseExit () {
 
guiTexture.texture = playNormal;
 
}
 
function OnMouseDown () {
 
Application.LoadLevel(Random.Range(4, Application.levelCount));
 
}
 
 
And if someone can add to this score +1 for onmousebutton

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...