• 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 Saint34x · Feb 06, 2013 at 07:02 PM · splash-screen

whats wrong with my Splash Screen Script?

im working through some tutorials Via Digital Tutors and the lesson im going through now is teach me a bit about creating a GameState. this includes a timer a opening splash screen and more. i've had a little bit of trouble but so far i've been able to work it all out. until now. right now he's having me apply a script to a empty obj. then he's having me apply another script called DisplayTextureFullScreen to the same game obj right now its supposed to be on the screen the whole time and we will get to where it will disappear BUT the splash screen will not appear. i've checked and double checked my code and i think it matches his perfectly.

here is the gamestate code

 var rounds : int = 1;
 var kills :int = 0;
 var curTimer : float = 10; //seconds
 
 
 //private
 var startTimer:float = curTimer;
 var roundTimer:float; //seconds at start of rounds
 
 var textureFullScreen:DisplayTextureFullScreen;
 
 function Start ()
 {
     curTimer = roundTimer = startTimer * rounds;
     if(!textureFullScreen)
     {
         textureFullScreen = GetComponent(DisplayTextureFullScreen);
     }
 }
 
 function Update ()
 {
     textureFullScreen.AlphaDown(Time.deltaTime);
     
     curTimer -= Time.deltaTime;
     Debug.Log("The timer is: " +curTimer);    
     // do something when timer hits zero
     if (curTimer<=0)
     {
         //won Round
     }
 }
 
 
 //high score menu
 
 
 
 
 
 //other functions for later
 
 function GetRoundsWon()
 {
     return rounds;    
 }
 
 function GetTimerPercent()
 {
     return curTimer/roundTimer;
 }
 
 function SaveStats()
 {
 
 }

and here is the DisplayTextureFullScreen script

 var graphic = TextureGUI(); //(28,23);
 var GUIColor:Color;
 
 function OnGUI() {
     GUI.color = GUIColor;
     if (graphic.texture) {
         GUI.DrawTexture(Rect(graphic.offset.x,graphic.offset.y,
                         Screen.width,Screen.height),
                         graphic.texture,ScaleMode.StretchToFill,true);
     }
 }
 
 function AlphaUp(change:float) {
     //if (GUIColor.a < 1) {
         GUIColor.a += change;
     //}
 }
 
 function setStartColor(color:Color) {
     GUIColor = color;
 }
 
 /*function getColor() {
     return GUIColor;
 }
 */
 
 function setDelay(delay:float) {
     if (GUIColor.a > .5) {
         GUIColor.a += delay;
     } else {
         GUIColor.a -= delay;
     }
 }
 
 function AlphaDown(change:float) {
     //if (GUIColor.a > 0) {
         GUIColor.a -= change;
     //}
 }

some of this script has me commented out because the script that came with the files is further along then what he shows in the tutorial so i commented out the code he hasnt told me to tye yet. but i have tried it with and with out the stuff commented out. any help you guys could give me would be crazy appreciated!

Comment
Add comment · Show 2
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 iwaldrop · Feb 06, 2013 at 08:09 PM 0
Share

What's your question? What's the error? There are some people who will comb through your code, or execute it even, for you, but many wont.

avatar image robertbu · Feb 06, 2013 at 09:04 PM 0
Share

You call TextureGUI() to get the texture you are going to display, but the code for that method is not here. Try changing that line to:

 var graphic : Texture;

Then drag a texture into the variable in the script. If that works, then you know the issue is with TextureGUI() and not in this script.

0 Replies

· Add your reply
  • Sort: 

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

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

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

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Setting Scroll View Width GUILayout 1 Answer

Material doesn't have a color property '_Color' 4 Answers

How to import the object from server to unity 2 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