Hello, I was wondering if AC by script, has somewhere the option to get the time played. Thanks!
A custom script can be used to update a Global Integer variable by one every second:
using UnityEngine; using AC; using System.Collections; public class TimePlayedRecorder : MonoBehaviour { public string variableName; private GVar variable; private void Start () { DontDestroyOnLoad (gameObject); variable = GlobalVariables.GetVariable (variableName); StartCoroutine (UpdateTimer ()); } private IEnumerator UpdateTimer () { while (true) { yield return new WaitForSeconds (1f); variable.IntegerValue += 1; } } }
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
A custom script can be used to update a Global Integer variable by one every second: