Answer the question
In order to leave comments, you need to log in
How to make time pass when you move to another scene?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.UI;
public class AddTable : MonoBehaviour
{
public float time;
public Button BonusBbttn;
public GameObject Stopimage;
public void ActivateAfter()
{
BonusBbttn.interactable = false;
Stopimage.gameObject.SetActive(true);
StartCoroutine(ActivateRoutine());
}
private IEnumerator ActivateRoutine()
{
yield return new WaitForSeconds(time);
BonusBbttn.interactable = true;
Stopimage.gameObject.SetActive(false);
}
}
Answer the question
In order to leave comments, you need to log in
You save the DateTime of the origin in PlayerPrefs, and when loading a new scene you compare, if: DateTime (current) - DateTime (from PlayerPrefs) > time (here you need to multiply by a coefficient, most likely 10 million), then you call the coroutine with the expectation "time - ( dateTimeCurrent - dateTimePrefs) / 10,000,000.
you need to save the state of the button on the server side (if the single is in saving the state of the game), and when entering the scene, simply request this state
Telepathy doesn't work on Friday. Starting from the seven - it can start, but no one will give you 100%.
For Windows, the operating mode of the disk controller is more important - there may be problems when switching to AHCI and back. It is easy to fix - before "updating" - changing the driver of the controller to which the boot disk is connected to a "standard IDE controller" or installing a SATA driver, depending on which direction the transition is.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question