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 /
  • Help Room /
avatar image
0
Question by CraftyMaelyss · Jan 27, 2017 at 12:33 AM · scripting problemapi

Updating the API in Unity destroyed my scripts, how do I reverse it?

Before the updates my scripts worked perfectly fine, no issues and they executed without a problem. I wanted to learn how to code my pause menu in my UIManager script so that when the pause menu was active, the music would stop playing, so I saw someone's post about the issue and read another person's answer that worked and added it to my script, which caused this to appear:

alt text

So naturally I backed up my entire folder onto a separate hard drive(as I regularly do) and then gave the okay to go ahead with the update.

After that, I assigned the script again to the NPC but found I got errors, so I opened the script and put the original script in before the edit. Now during test play, I go to pause the game and notices the screen freezes but my pause menu is nowhere to be seen. I close then reopen it without saving and tried again, only for the same issue to occur.

So I got to the canvas for the pause menu and start deactivating each object and playing to find out what's wrong as I know the script works. After deactivating the buttons and pressing play, my canvas appears once again however my pause menu needs those buttons as they're pretty vital. The buttons are resume, restart, help, main menu and quit, so I can't just overlook this serious issue.

This all happened after I updated the API. After spending several days looking around and coming up with nothing, I really, really need help from the community now more then ever.

How do I reverse the API update? Do I download a previous version of Unity or is there something else that I need to do to get this vital script and pause menu working? The UIManager script is in all scenes in my game and in them the script works fine, it loads and plays without a problem, the transitions between scenes are just fine, the main issue is just that the main menu won't appear when I press the Esc button now unless I uncheck the buttons in the inspector to deactivate them but again those buttons are vital and I need them working.

If it helps, here's a copy of my UIManager:

using UnityEngine; using System.Collections;

public class UIManager : MonoBehaviour { private GameObject[] PauseMenu;

 // Use this for initialization
 void Start()
 {
     Time.timeScale = 1;
     PauseMenu = GameObject.FindGameObjectsWithTag("ShowOnPause");
     hidePaused();
 }

 // Update is called once per frame
 void Update()
 {
     //uses the Esc button to pause and unpause the game
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         if (Time.timeScale == 1)
         {
             Time.timeScale = 0;
             showPaused();
         }
         else if (Time.timeScale == 0)
         {
             Debug.Log("high");
             Time.timeScale = 1;
             hidePaused();
         }
     }
 }


 //Reloads the Level
 public void Reload()
 {
     Application.LoadLevel(Application.loadedLevel);
 }

 //controls the pausing of the scene
 public void pauseControl()
 {
     if (Time.timeScale == 1)
     {
         Time.timeScale = 0;
         showPaused();
     }
     else if (Time.timeScale == 0)
     {
         Time.timeScale = 1;
         hidePaused();
     }
 }

 //shows objects with ShowOnPause tag
 public void showPaused()
 {
     foreach (GameObject g in PauseMenu)
     {
         g.SetActive(true);
     }
 }

 //hides objects with ShowOnPause tag
 public void hidePaused()
 {
     foreach (GameObject g in PauseMenu)
     {
         g.SetActive(false);
     }
 }

 //loads inputted level
 public void LoadLevel(string level)
 {
     Application.LoadLevel(level);
 }

 //exits game
 public void doExitGame()
 {
     Application.Quit();
 }

}

I would appreciate any advice or help on this matter :)

1bhh6.png (99.2 kB)
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

1 Reply

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

Answer by CraftyMaelyss · Jan 27, 2017 at 02:42 AM

Well I wasn't able to reverse the changes BUT this alternative might help some developers: (All of my games I keep backed up on a separate hard drive.)

  1. Take screenshots or write down notes for what you've implied and how to do it.

  2. Create a folder on your desktop and call it GameName temp(game name being what your game is called and actually do it on the desktop so you find it easy)

  3. Copy your current game's folder's contents into the temp one.

  4. Open Unity to double check the location of your game.

  5. Delete the contents in the bad game folder that isn't work BUT DO NOT DELETE THE FOLDER ITSELF!

  6. Open the folder of your backup then copy and paste all contents into the now empty folder.

  7. DO NOT DELETE THE TEMP FOLDER, you will need this in case this doesn't work.

  8. Open Unity and make sure "pause on errors" isn't marked otherwise the game won't play.

  9. Go get yourself a sweet treat, you just fixed your game :).

Hopefully this helps some people out who got stuck just like I did and if you need screenshots, feel free to ask and I will upload links, since I think you can only upload 1-2 screenshots in an answer P:

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

110 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[SOLVED] Unit IAP google play response to update result 1 Answer

LensFlare Doesn't Contain "brightness" Definition?!?! 0 Answers

How do I add music code to my C# without getting a API update prompt? 1 Answer

Steam Leaderboards in Unity, upload time since level load 0 Answers

C# Unity5.3 SceneManager -- Unloading and Loading a specific instance of a Scene. 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