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.

DestinyAwaits

Newbie
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About DestinyAwaits

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location:
    USA
  1. Oh keyboard/mouse doesn't react when timescale = 0? I need time to freeze for my game, as it is needed for players to pick an action by clicking a button. Once the button is clicked, the game will unfreeze.
  2. public void makeProduct(string message) { makeButton.gameObject.SetActive (true); makePanel.SetActive (true); make2button.gameObject.SetActive(true); totalDev.gameObject.SetActive(true); totalDev.GetComponent<Text>().text = "Total Development Cost: $" + totalMake.ToString(); GetComponent<timeScript>().StopTimer(); } public void stopProduct() { print (gameName); if (pickedsystem == "Develop for:") { } else { makeButton.gameObject.SetActive(false); makePanel.SetActive(false); } GetComponent<timeScript>().StartTimer(); } I tried to make it in my gameDictionaries script that time would freeze, then having it resume when stopProduct is started. Then I had the following in my timeScript script(note, a lot of info here is useless as it is used for other parts): void Start() { InvokeRepeating("Timer", 0, 1); } public void Timer() { timeText.GetComponent<Text>().text = "W" + week.ToString() + "" + year.ToString() + " Day " + day.ToString(); playerCash.GetComponent<Text>().text = "$" + myCash.ToString(); #region YEAR //Check if month equals 13 (allows for 12th month to be counted) if (month == 13) { year++; month = 0; } #endregion #region MONTH //Check if week equals 5 (allows for 5th week to be counted) if (month == 5) { month++; week = 0; } #endregion #region WEEK //Check if day equals 8 (allows for 7th day to be counted) if (day == 8) { week++; day = 0; } #endregion #region DAY //Check if Time equals 5 (allows for 4 seconds) if (time == 1) { day++; time = 0; } else { time++; } #endregion if (week == 2 && month == 0 && year == 1980) { alert.PopUp("Welcome to iDeveloper! This is a pre-playable build that is not intended for consumer use"); } else if (week == 4 && month == 0 && year == 1980) { alert.PopUp("To create a game, go to Make Game"); } else if (week == 1 && month == 1 && year == 1981) { alert.PopUp("Create a game so you can earn money and grow your company!"); print("FES Coming in 4 years"); } print(week); print(month); print(year); } public void StartTimer() { InvokeRepeating("TimerFunction", 0, 1); Time.timeScale = 1f; } public void StopTimer() { CancelInvoke("Timer"); Time.timeScale = 0; } } The issue is, time isn't resuming when StartTimer is called. What could I do to get time to resume?
  3. What is on your christmas list this year? Anything you really want or dream of having?
  4. Hey everyone, newbie here! Been using Unity for a while! Trying to make a tycoon game atm and been having a lot of fun doing that! I look forward to posting in the forums here! I love the walking dead, halo, and Destiny. I also love writing stories, especially on sci-fi or apocalyptic topics!
×
×
  • Create New...