Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 senluc · May 29, 2011 at 10:55 AM · gameobjectcharactersystemselection

Character selection system help script

Character selection system help:

So I need help with the system for selection of characters.

in the first image you see is the screen of choice of characters. http://img12.imageshack.us/img12/9408/normalnomouse.jpg

in the second picture you see is when I press the button face naruto,i need change texture with a red texture,is simultaneously to come out Naruto as Gameobject, is his name as gameobject or GUItexture.

http://img804.imageshack.us/img804/3514/withmouse.jpg

in the third picture shows that when I press a new character must again set the texture face naruto normal, it must come out the new player, as selected in this case gaara.

http://img171.imageshack.us/img171/504/selectanothercharacter.jpg

i hope that anyone can help me

thx for the reading Senluc.

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

Answer by G_Sacristan · May 29, 2011 at 12:15 PM

i thought i understood what U want;

My way to change texture is

 var inactive: Texture2D;//inactive texture
 var active: Texture2D;//active texture;
 var defaultChar:boolean;
 private var active:boolean=false;
 
 function Start()
 {
      if(defaultChar) 
      {
           guiTexture.texture=active;//if u want to start with a default character... just press check in inspector
           active=true;
      }
      else
     {
           guiTexture.texture=false;//if u want to start with a default character... just press check in inspector
           active=false;
     }
 }
 
 function OnMouseUp()
 {
      if(!active) guiTexture.texture=active;
      if(active) guiTexture.texture=inactive;
 }
Comment
Add comment · Show 4 · 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 G_Sacristan · May 29, 2011 at 12:16 PM 0
Share

attach this script to each object with guiTexture attached

PS. if u want to do it on iOS then use HitTest in Update function.

avatar image senluc · May 29, 2011 at 01:36 PM 0
Share

I have got some errors about "private var active" because is been used for " var active: Texture2D;//active texture;" Unity say me that "active" is already has a definition for active. btw if i change the name active with another one,i've got a boolean error from "function Start". that is all. but thx for answer

avatar image G_Sacristan · May 29, 2011 at 01:59 PM 0
Share

sorry - shit happens!

avatar image senluc · May 29, 2011 at 02:04 PM 0
Share

no problem

avatar image
0

Answer by senluc · May 29, 2011 at 01:26 PM

oky i try,and thx a lot for the fast answer xD

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

2 People are following this question.

avatar image avatar image

Related Questions

Char select / GUI button question. 3 Answers

Selected object into next scene? 3 Answers

How to get component of any button that is clicked? (Using same function for every button) 2 Answers

GameObject.Find("In-Game-Object") Position 3 Answers

Unity Crashes when C# script with code inside class but outside function is added to a GameObject 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